diff --git a/src/pages/auth/components/LoginStep1.tsx b/src/pages/auth/components/LoginStep1.tsx index 9626e4d..8303a11 100644 --- a/src/pages/auth/components/LoginStep1.tsx +++ b/src/pages/auth/components/LoginStep1.tsx @@ -18,7 +18,7 @@ type LoginStep1FormType = { const LoginStep1: FC = () => { const { t } = useTranslation('global') - const { setPhone, phone, setStepLogin, setSlug, setOtp } = useAuthStore() + const { setPhone, phone, setStepLogin, setSlug } = useAuthStore() const loginWithOtp = useLoginWithOtp() const formik = useFormik({ @@ -36,8 +36,7 @@ const LoginStep1: FC = () => { setPhone(values.phone) setSlug(values.slug) loginWithOtp.mutate(values, { - onSuccess(data) { - setOtp(data?.data?.code || '') + onSuccess() { setStepLogin(2) toast.success(t('auth.otp_sent')) }, diff --git a/src/pages/auth/components/LoginStep2.tsx b/src/pages/auth/components/LoginStep2.tsx index 9d798b3..404820a 100644 --- a/src/pages/auth/components/LoginStep2.tsx +++ b/src/pages/auth/components/LoginStep2.tsx @@ -16,13 +16,13 @@ import { setToken, setRefreshToken } from '../../../config/func' const LoginStep2: FC = () => { const { t } = useTranslation('global') - const { phone, setStepLogin, slug, otp } = useAuthStore() + const { phone, setStepLogin, slug } = useAuthStore() const { value } = useCountDown(2, true) const otpVerify = useOtpVerify() const formik = useFormik<{ otp: string }>({ initialValues: { - otp: otp + otp: '' }, validationSchema: Yup.object({ otp: Yup.string()