diff --git a/website/src/pages/auth/signin.tsx b/website/src/pages/auth/signin.tsx index 4afc3102..1dcbf211 100644 --- a/website/src/pages/auth/signin.tsx +++ b/website/src/pages/auth/signin.tsx @@ -1,19 +1,26 @@ import { Button, Input, Stack } from "@chakra-ui/react"; import Head from "next/head"; -import { FaDiscord, FaEnvelope, FaGithub } from "react-icons/fa"; +import { FaDiscord, FaEnvelope, FaGithub, FaBug } from "react-icons/fa"; import { getCsrfToken, getProviders, signIn } from "next-auth/react"; -import { useRef } from "react"; +import React, { useRef } from "react"; import Link from "next/link"; import { AuthLayout } from "src/components/AuthLayout"; export default function Signin({ csrfToken, providers }) { - const { discord, email, github } = providers; + const { discord, email, github, credentials } = providers; const emailEl = useRef(null); - const signinWithEmail = () => { + const signinWithEmail = (ev: React.FormEvent) => { + ev.preventDefault(); signIn(email.id, { callbackUrl: "/", email: emailEl.current.value }); }; + const debugUsernameEl = useRef(null); + function signinWithDebugCredentials(ev: React.FormEvent) { + ev.preventDefault(); + signIn(credentials.id, { callbackUrl: "/", username: debugUsernameEl.current.value }); + } + return ( <> @@ -22,19 +29,26 @@ export default function Signin({ csrfToken, providers }) { + {credentials && ( +
+ For Debugging Only + + + + +
+ )} {email && ( - - - - +
+ + + + +
)} {discord && (