feat: send email to user on successful password reset

This commit is contained in:
Ephraim Atta-Duncan
2023-09-18 14:31:04 +00:00
parent f561ef3cda
commit 166cbc150f
6 changed files with 57 additions and 15 deletions

View File

@ -43,10 +43,7 @@ export const ForgotPasswordForm = ({ className }: ForgotPasswordFormProps) => {
const { mutateAsync: forgotPassword } = trpc.profile.forgotPassword.useMutation();
const onFormSubmit = async ({ email }: TForgotPasswordFormSchema) => {
// check if the email is available
// if not, throw an error
// if the email is available, create a password reset token and send an email
// TODO: Handle error with try/catch
await forgotPassword({
email,
});