remove otp code

This commit is contained in:
hamid zarghami
2026-01-01 12:47:50 +03:30
parent 120afa5b8d
commit 4bfed0b598
2 changed files with 4 additions and 9 deletions
@@ -28,8 +28,6 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
const { t } = useTranslation('auth') const { t } = useTranslation('auth')
const { name } = useParams() const { name } = useParams()
const [step, setStep] = useState(AUTH_STEP.ENTER_NUMBER) const [step, setStep] = useState(AUTH_STEP.ENTER_NUMBER)
const [code, setCode] = useState('')
const { mutate: mutateOtpRequest, isPending } = useOtpRequest() const { mutate: mutateOtpRequest, isPending } = useOtpRequest()
@@ -45,9 +43,7 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
if (name) { if (name) {
values.slug = name as string values.slug = name as string
mutateOtpRequest(values, { mutateOtpRequest(values, {
onSuccess: (data) => { onSuccess: () => {
setCode(data?.data?.code)
toast(t('otp_sent'), 'success') toast(t('otp_sent'), 'success')
setStep(AUTH_STEP.ENTER_OTP) setStep(AUTH_STEP.ENTER_OTP)
}, },
@@ -104,7 +100,7 @@ function StepEnterNumber(_props: StepEnterNumberProps = {}) {
/> />
)} )}
{step === AUTH_STEP.ENTER_OTP && ( {step === AUTH_STEP.ENTER_OTP && (
<StepOtp phone={formik.values.phone} slug={formik.values.slug} code={code} /> <StepOtp phone={formik.values.phone} slug={formik.values.slug} />
)} )}
</div> </div>
{ {
+2 -3
View File
@@ -17,10 +17,9 @@ import { useSearchParams } from 'next/navigation'
type Props = { type Props = {
phone: string, phone: string,
slug: string slug: string
code: string
} }
const StepOtp = ({ phone, slug, code }: Props) => { const StepOtp = ({ phone, slug }: Props) => {
const searchParams = useSearchParams() const searchParams = useSearchParams()
const redirectUrl = searchParams.get('redirect') const redirectUrl = searchParams.get('redirect')
const { t } = useTranslation('auth') const { t } = useTranslation('auth')
@@ -39,7 +38,7 @@ const StepOtp = ({ phone, slug, code }: Props) => {
const formik = useFormik<LoginVerifyOTPType>({ const formik = useFormik<LoginVerifyOTPType>({
initialValues: { initialValues: {
phone: phone, phone: phone,
otp: code, otp: '',
slug: slug slug: slug
}, },
validationSchema: Yup.object({ validationSchema: Yup.object({