import SubmitButton from "@/components/SubmitButton"; 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 ( <> Linkwarden

Fogot Password?

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.

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-500 duration-100" />
Go back

© {new Date().getFullYear()} Linkwarden. All rights reserved.{" "}

); }