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

@ -5,6 +5,7 @@ import backgroundPattern from '~/assets/background-pattern.png';
import { ForgotPasswordForm } from '~/components/forms/forgot-password';
export default function ForgotPasswordPage() {
// TODO: Fix width reducing with screen size
return (
<main className="bg-sand-100 relative flex min-h-screen flex-col items-center justify-center overflow-hidden px-4 py-12 md:p-12 lg:p-24">
<div className="relative flex w-1/5 items-center gap-x-24">

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,
});