This commit is contained in:
2026-07-02 00:34:07 +03:30
parent e097f6b2bb
commit a41dd6ef9e
12 changed files with 93 additions and 26 deletions
@@ -17,6 +17,7 @@ import { useWalletStore } from '@/store/walletStore'
import { useSettingsStore } from '@/store/settingsStore'
import { setTruth } from '@/app/authBoot'
import { completeLoginNavigation } from '@/layouts/composables/useMobileScrollReset'
import { normalizeAuthFormFields } from '@/utils/persianDigits'
export function useLoginForm() {
const { time, onFinish, reset } = useCountdownTimer('00:02:00', 'mm:ss')
@@ -41,6 +42,7 @@ export function useLoginForm() {
async function reSendCode() {
userFormState.token = undefined
enableSendAgainCode.value = false
normalizeAuthFormFields(userFormState)
await loginCustomer(userFormState)
reset()
}
@@ -64,10 +66,12 @@ export function useLoginForm() {
function handleOnChange(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
}
async function handleOnComplete(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
phoneVerification()
}
@@ -103,6 +107,7 @@ export function useLoginForm() {
formRef.value?.validateFields().then(async () => {
try {
loading.value = true
normalizeAuthFormFields(userFormState)
if (isSMS.value) {
if (!stepTwoVerify.value) {
userFormState.token = undefined