Use password login without OTP; keep OTP for signup and optional mobile login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 01:37:15 +03:30
co-authored by Cursor
parent 78511a7d53
commit 55d9b494e6
7 changed files with 232 additions and 138 deletions
+11 -4
View File
@@ -10,13 +10,11 @@ import {
import { BUSINESS_FIELDS } from '@mento/shared';
export class LoginDto {
/** ایمیل یا موبایل — کلاینت جدید */
@IsOptional()
@IsString()
@MinLength(3)
identifier?: string;
/** سازگاری با کلاینت قدیمی */
@IsOptional()
@IsEmail()
email?: string;
@@ -26,7 +24,15 @@ export class LoginDto {
password!: string;
}
export class LoginVerifyOtpDto {
export class LoginOtpRequestDto {
@IsString()
@Matches(/^09\d{9}$|^\+98\d{10}$|^98\d{10}$|^9\d{9}$/, {
message: 'شماره موبایل معتبر نیست',
})
mobile!: string;
}
export class LoginOtpVerifyDto {
@IsString()
challengeId!: string;
@@ -77,9 +83,10 @@ export class RegisterVerifyOtpDto {
@IsString()
challengeId!: string;
@IsOptional()
@IsString()
@MinLength(4)
emailCode!: string;
emailCode?: string;
@IsString()
@MinLength(4)