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