fix: Delete my account code confirmation step missing

This commit is contained in:
Tom Moor
2024-02-01 07:39:17 -05:00
parent fde8a9fd88
commit 92d5a7ee89

View File

@@ -36,12 +36,11 @@ function UserDelete({ onSubmit }: Props) {
try {
await auth.requestDeleteUser();
setWaitingCode(true);
onSubmit();
} catch (err) {
toast.error(err.message);
}
},
[auth, onSubmit]
[auth]
);
const handleSubmit = React.useCallback(
@@ -49,11 +48,12 @@ function UserDelete({ onSubmit }: Props) {
try {
await auth.deleteUser(data);
await auth.logout();
onSubmit();
} catch (err) {
toast.error(err.message);
}
},
[auth]
[auth, onSubmit]
);
const inputProps = register("code", {