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 { 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 && (
<StepOtp phone={formik.values.phone} slug={formik.values.slug} code={code} />
<StepOtp phone={formik.values.phone} slug={formik.values.slug} />
)}
</div>
{
+2 -3
View File
@@ -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<LoginVerifyOTPType>({
initialValues: {
phone: phone,
otp: code,
otp: '',
slug: slug
},
validationSchema: Yup.object({