import Layout from "app/core/layouts/Layout" import { LabeledTextField } from "app/core/components/LabeledTextField" import { Form, FORM_ERROR } from "app/core/components/Form" import { ForgotPassword } from "app/auth/validations" import forgotPassword from "app/auth/mutations/forgotPassword" import { useMutation } from "@blitzjs/rpc" import { BlitzPage } from "@blitzjs/next" const ForgotPasswordPage: BlitzPage = () => { const [forgotPasswordMutation, { isSuccess }] = useMutation(forgotPassword) return (

Forgot your password?

{isSuccess ? (

Request Submitted

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

) : (
{ try { await forgotPasswordMutation(values) } catch (error: any) { return { [FORM_ERROR]: "Sorry, we had an unexpected error. Please try again.", } } }} > )}
) } export default ForgotPasswordPage