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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user