edit login & otp

This commit is contained in:
2026-05-31 14:06:42 +03:30
parent 9eddcbd2a7
commit a87478d5b9
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ export class AuthService {
const mobile = this.normalizeMobile(dto.mobile);
const code = String(dto.code ?? '').trim();
if (!/^\d{4,8}$/.test(code)) {
if (!/^\d{4}$/.test(code)) {
throw new BadRequestException('Invalid OTP code');
}
@@ -283,7 +283,7 @@ export class AuthService {
}
private generateOtpCode(): string {
return String(randomInt(100000, 1000000));
return String(randomInt(1000, 10000));
}
private hashOtp(mobile: string, code: string): string {