fix: Delete my account code confirmation step missing
This commit is contained in:
@@ -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", {
|
||||||
|
|||||||
Reference in New Issue
Block a user