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
+14 -5
View File
@@ -2,7 +2,8 @@ import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
import { AuthService } from './auth.service';
import {
LoginDto,
LoginVerifyOtpDto,
LoginOtpRequestDto,
LoginOtpVerifyDto,
RegisterOrganizationDto,
RegisterVerifyOtpDto,
} from './dto';
@@ -23,14 +24,22 @@ export class AuthController {
return this.authService.verifyRegister(dto);
}
/** ورود با رمز (بدون OTP) */
@Post('login')
login(@Body() dto: LoginDto) {
return this.authService.loginLegacy(dto);
return this.authService.loginWithPassword(dto);
}
@Post('login/verify')
loginVerify(@Body() dto: LoginVerifyOtpDto) {
return this.authService.verifyLogin(dto);
/** درخواست کد ورود با موبایل */
@Post('login/otp')
loginOtpRequest(@Body() dto: LoginOtpRequestDto) {
return this.authService.requestLoginOtp(dto);
}
/** تأیید کد ورود با موبایل */
@Post('login/otp/verify')
loginOtpVerify(@Body() dto: LoginOtpVerifyDto) {
return this.authService.verifyLoginOtp(dto);
}
@UseGuards(JwtAuthGuard)