diff --git a/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx b/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx index 5104bfd..f417afa 100644 --- a/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx +++ b/platforms/market/src/app/screens/(auth)/auth/organisms/code-step/CodeStep.tsx @@ -11,12 +11,13 @@ import type { FormEvent } from 'react'; import { Controller } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; +import { CODE_RULES } from '../../../../../../features/auth'; import { formatMobile, translateMessage } from '../../../../../../shared/utils'; import { SupportEntry } from '../../../../organisms/support-entry'; import type { CodeStepProps } from './types'; /** - * The 6-digit code step of login and registration: the number it went to, the cells, the resend + * The 5-digit code step of login and registration: the number it went to, the cells, the resend * wait and the submit button under them. Blocked, the cells and the button rest and the wait * counts to the moment a new code may be asked for; «ویرایش شماره» stays live. Limited (too many * codes in an hour), only the wait is amber: the last code can still be typed. @@ -78,6 +79,7 @@ export function CodeStep({ { diff --git a/platforms/market/src/features/auth/constants.ts b/platforms/market/src/features/auth/constants.ts index b700245..5156f09 100644 --- a/platforms/market/src/features/auth/constants.ts +++ b/platforms/market/src/features/auth/constants.ts @@ -14,12 +14,12 @@ export const AUTH_EVENTS = { export const AUTH_PURPOSES = ['login', 'register'] as const; /** - * The code rules the pages show. The server owns them (a code lives 10 minutes, the third wrong + * The code rules the pages show. The server owns them (5 digits, a code lives 2 minutes, the third wrong * code blocks the number for 10 minutes, at most 5 codes per number in an hour); the 2-minute - * resend wait is the product's, longer than the server's 60-second cooldown. + * resend opens when the code runs out. */ export const CODE_RULES = { - length: 6, + length: 5, resendWaitSeconds: 120, maxMisses: 3, blockSeconds: 600, diff --git a/platforms/market/src/shared/locales/fa/auth.json b/platforms/market/src/shared/locales/fa/auth.json index 97163cd..0a4c326 100644 --- a/platforms/market/src/shared/locales/fa/auth.json +++ b/platforms/market/src/shared/locales/fa/auth.json @@ -44,8 +44,8 @@ }, "code": { "title": "کد تأیید را وارد کنید", - "description": "کد 6 رقمی ارسال‌شده به {{phone}} را وارد کنید.", - "label": "کد تأیید 6 رقمی", + "description": "کد 5 رقمی ارسال‌شده به {{phone}} را وارد کنید.", + "label": "کد تأیید 5 رقمی", "edit-phone": "ویرایش شماره", "wrong": "کد وارد‌شده اشتباه است. لطفاً دوباره تلاش کنید.", "wrong-last": "کد وارد‌شده اشتباه است. یک تلاش دیگر باقی مانده است.", @@ -297,7 +297,7 @@ }, "validation": { "phone-invalid": "شماره موبایل وارد‌شده معتبر نیست.", - "code-length": "کد 6 رقمی را کامل وارد کنید.", + "code-length": "کد 5 رقمی را کامل وارد کنید.", "role-required": "نوع حساب را انتخاب کنید.", "required": "این فیلد الزامی است.", "first-name-persian": "لطفاً نام را به فارسی وارد کنید.", diff --git a/platforms/market/src/shared/validations/constants.ts b/platforms/market/src/shared/validations/constants.ts index 39c657d..adfb7db 100644 --- a/platforms/market/src/shared/validations/constants.ts +++ b/platforms/market/src/shared/validations/constants.ts @@ -22,7 +22,7 @@ export const ID_CARD_SIDES = [ export const ACCOUNT_TYPES = ['investor', 'creator'] as const; -export const CODE_PATTERN = /^\d{6}$/; +export const CODE_PATTERN = /^\d{5}$/; /** The server's creator profile rules (`CREATOR_PROFILE_LIMITS`), so forms reject what the API would. */ export const PROFILE_LIMITS = {