verify code slicing & function
This commit is contained in:
@@ -37,8 +37,6 @@ export default function VerifyCode() {
|
||||
useEffect(() => {
|
||||
if (state === null) {
|
||||
navigate('/auth/login');
|
||||
} else {
|
||||
console.log(state);
|
||||
}
|
||||
}, [state, navigate]);
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ export default function VerifyCodeForm({ phoneOrEmail }: Props) {
|
||||
|
||||
const onSubmit = async (data: FormValuesProps) => {
|
||||
try {
|
||||
await new Promise((resolve) => setTimeout(resolve, 750));
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
await validateOtp(phoneOrEmail, Object.values(data).join(''));
|
||||
enqueueSnackbar('Verify success!');
|
||||
navigate('/dashboard');
|
||||
enqueueSnackbar('Verify success!', { variant: 'success' });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user