logo otp auto

This commit is contained in:
hamid zarghami
2026-07-25 10:27:35 +03:30
parent 09feb73331
commit 153547d098
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -35,7 +35,8 @@
"enter_password_step3": "رمز عبور را وارد کنید",
"enter_your_password": "رمز عبور خود را وارد کنید.",
"forgot_password": "فراموشی رمز عبور",
"login_with_otp": "ورود با رمز عبور یکبار مصرف"
"login_with_otp": "ورود با رمز عبور یکبار مصرف",
"otp_sent": "رمز یک بار مصرف برای شما ارسال شد"
},
"errors": {
"required": "این فیلد اجباری می باشد",
+7 -1
View File
@@ -78,7 +78,13 @@ const LoginStep2: FC = () => {
value={formik.values.code}
numInputs={5}
inputType='tel'
onChange={(otp: string) => formik.setFieldValue('code', otp)}
onChange={(otp: string) => {
formik.setFieldValue('code', otp).then(() => {
if (otp.length === 5 && !otpVerify.isPending) {
formik.submitForm()
}
})
}}
renderInput={(props) => <input {...props} className='w-full h-[50px] flex-1 mx-2 bg-white border rounded-2.5' />}
/>
</div>