import SubmitButton from "@/components/SubmitButton"; import CenteredForm from "@/layouts/CenteredForm"; import { signIn } from "next-auth/react"; import Image from "next/image"; import Link from "next/link"; import { 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 loginUser() { 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 })} className="w-full rounded-md p-2 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-700 duration-100" />
Go back
); }