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