diff --git a/src/features/auth/components/StepEnterNumber.tsx b/src/features/auth/components/StepEnterNumber.tsx
index 8e9df53..2e8e429 100644
--- a/src/features/auth/components/StepEnterNumber.tsx
+++ b/src/features/auth/components/StepEnterNumber.tsx
@@ -28,8 +28,6 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
const { t } = useTranslation('auth')
const { name } = useParams()
const [step, setStep] = useState(AUTH_STEP.ENTER_NUMBER)
- const [code, setCode] = useState('')
-
const { mutate: mutateOtpRequest, isPending } = useOtpRequest()
@@ -45,9 +43,7 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
if (name) {
values.slug = name as string
mutateOtpRequest(values, {
- onSuccess: (data) => {
- setCode(data?.data?.code)
-
+ onSuccess: () => {
toast(t('otp_sent'), 'success')
setStep(AUTH_STEP.ENTER_OTP)
},
@@ -104,7 +100,7 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
/>
)}
{step === AUTH_STEP.ENTER_OTP && (
-
+
)}
{
diff --git a/src/features/auth/components/StepOtp.tsx b/src/features/auth/components/StepOtp.tsx
index bd6b5f0..fd31edf 100644
--- a/src/features/auth/components/StepOtp.tsx
+++ b/src/features/auth/components/StepOtp.tsx
@@ -17,10 +17,9 @@ import { useSearchParams } from 'next/navigation'
type Props = {
phone: string,
slug: string
- code: string
}
-const StepOtp = ({ phone, slug, code }: Props) => {
+const StepOtp = ({ phone, slug }: Props) => {
const searchParams = useSearchParams()
const redirectUrl = searchParams.get('redirect')
const { t } = useTranslation('auth')
@@ -39,7 +38,7 @@ const StepOtp = ({ phone, slug, code }: Props) => {
const formik = useFormik({
initialValues: {
phone: phone,
- otp: code,
+ otp: '',
slug: slug
},
validationSchema: Yup.object({