chore: change the login and regitster flow to single route

This commit is contained in:
mahyargdz
2025-08-16 12:50:58 +03:30
parent 629b8dbdd5
commit ef57dc7107
24 changed files with 340 additions and 235 deletions
-14
View File
@@ -3,7 +3,6 @@ import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { Throttle, ThrottlerGuard } from "@nestjs/throttler";
import { ChangePasswordDto } from "./DTO/change-password.dto";
import { CompleteRegistrationDto } from "./DTO/complete-register.dto";
import { CheckUserExistDto, LoginPasswordDTO } from "./DTO/loginPassword.dto";
import { RefreshTokenDto } from "./DTO/refresh-token.dto";
import { RequestOtpDto } from "./DTO/request-otp.dto";
@@ -27,19 +26,6 @@ export class AuthController {
private readonly ssoService: SSOService,
) {}
@ApiOperation({ summary: "Initiate registration" })
@HttpCode(HttpStatus.OK)
@Post("register/initiate")
register(@Body() registerDto: RequestOtpDto) {
return this.authService.initiateRegistration(registerDto);
}
@ApiOperation({ summary: "complete registration ==> step 2" })
@Post("register/complete")
completeRegistration(@Body() completeRegistrationDto: CompleteRegistrationDto) {
return this.authService.completeRegistration(completeRegistrationDto);
}
@ApiOperation({ summary: "request to login with otp" })
@HttpCode(HttpStatus.OK)
@Post("otp/send")