The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
Display sucessful password reset request
Ephraim Atta-Duncanc47e01b2b8d3
diff --git a/apps/web/components/forgot-password.tsx b/apps/web/components/forgot-password.tsxindex 7a7ec0356..bb55bfb66 100644--- a/apps/web/components/forgot-password.tsx+++ b/apps/web/components/forgot-password.tsx@@ -1,3 +1,4 @@+import { useState } from "react";import Link from "next/link";import { Button } from "@documenso/ui";import Logo from "./logo";@@ -9,12 +10,14 @@ interface IForgotPassword {email: string;}-export default function ForgotPassword(props: any) {+export default function ForgotPassword() {const methods = useForm<IForgotPassword>();const { register, formState, resetField } = methods;+ const [resetSuccessful, setResetSuccessful] = useState(false);+const onSubmit = async (values: IForgotPassword) => {- await toast.promise(+ const response = await toast.promise(fetch(`/api/auth/forgot-password`, {method: "POST",headers: {@@ -29,11 +32,39 @@ export default function ForgotPassword(props: any) {});- resetField("email");+ if (response.ok) {+ setResetSuccessful(true);+ }- console.log(values);+ resetField("email");};+ if (resetSuccessful) {+ return (+ <div className="flex min-h-full items-center justify-center py-12 px-4 sm:px-6 lg:px-8">+ <div className="w-full max-w-md space-y-8">+ <div>+ <Logo className="mx-auto h-20 w-auto"></Logo>+ <h2 className="mt-6 text-center text-3xl font-bold tracking-tight text-gray-900">+ Reset Password+ </h2>+ <p className="mt-2 text-center text-sm text-gray-600">+ Please check your email for reset instructions.+ </p>+ </div>+ <div>+ <Link href="/login">+ <div className="relative mt-10 flex items-center justify-center gap-2 text-sm text-gray-500 hover:cursor-pointer hover:text-gray-900">+ <ArrowLeftIcon className="h-4 w-4" />+ Back to log in+ </div>+ </Link>+ </div>+ </div>+ </div>+ );+ }+return (<><div className="flex min-h-full items-center justify-center py-12 px-4 sm:px-6 lg:px-8">