remove code from api
This commit is contained in:
@@ -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<LoginStep1FormType>({
|
||||
@@ -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'))
|
||||
},
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user