import type { BlitzPage } from "blitz"; import { Routes, useMutation } from "blitz"; import BaseLayout from "app/core/layouts/base-layout"; import { AuthForm as Form, FORM_ERROR } from "../components/auth-form"; import { LabeledTextField } from "../components/labeled-text-field"; import { ForgotPassword } from "../validations"; import forgotPassword from "app/auth/mutations/forgot-password"; const ForgotPasswordPage: BlitzPage = () => { const [forgotPasswordMutation, { isSuccess, reset }] = useMutation(forgotPassword); return (
{ try { reset(); await forgotPasswordMutation(values); } catch (error: any) { return { [FORM_ERROR]: "Sorry, we had an unexpected error. Please try again.", }; } }} > {isSuccess ? (

If your email is in our system, you will receive instructions to reset your password shortly.

) : ( )} ); }; ForgotPasswordPage.redirectAuthenticatedTo = Routes.Messages(); ForgotPasswordPage.getLayout = (page) => {page}; export default ForgotPasswordPage;