import SubmitButton from "@/components/SubmitButton"; import TextInput from "@/components/TextInput"; import CenteredForm from "@/layouts/CenteredForm"; import { signIn } from "next-auth/react"; import Link from "next/link"; import { FormEvent, useState } from "react"; import { toast } from "react-hot-toast"; interface FormData { email: string; } export default function Forgot() { const [submitLoader, setSubmitLoader] = useState(false); const [form, setForm] = useState({ email: "", }); async function sendConfirmation(event: FormEvent) { event.preventDefault(); if (form.email !== "") { setSubmitLoader(true); const load = toast.loading("Sending login link..."); await signIn("email", { email: form.email, callbackUrl: "/", }); toast.dismiss(load); setSubmitLoader(false); toast.success("Login link sent."); } else { toast.error("Please fill out all the fields."); } } return (

Password Recovery

Enter your email so we can send you a link to recover your account. Make sure to change your password in the profile settings afterwards.

You wont get logged in if you haven't created an account yet.

Email

setForm({ ...form, email: e.target.value })} />
Go back
); }