{{#if framework == "nextjs"}} "use client"; {{/if}} import InputField from "@/components/global/form-field/input-field"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { useForgotPasswordMutation } from "@/features/auth/queries/auth.mutations"; import { forgotZodSchema } from "@/features/auth/validators/forgot.validator"; import { zodResolver } from "@hookform/resolvers/zod"; {{#if framework == "nextjs"}} import Link from "next/link"; {{else}} import { Link } from "react-router"; {{/if}} import { FormProvider, useForm } from "react-hook-form"; type ForgotValues = { email: string; }; export default function ForgotPasswordForm() { const mutation = useForgotPasswordMutation(); const form = useForm({ mode: "onTouched", resolver: zodResolver(forgotZodSchema), defaultValues: { email: "" }, }); async function onSubmit(values: ForgotValues) { try { await mutation.mutateAsync(values); } catch {} } return ( Forgot password Enter your email to receive a password reset OTP
{{#if framework == "nextjs"}} Back to sign in {{else}} Back to sign in {{/if}}
); }