chore: add register of user

This commit is contained in:
mahyargdz
2025-01-20 12:50:04 +03:30
parent 53a3d46ef5
commit 7431dad85f
16 changed files with 224 additions and 51 deletions
+47 -2
View File
@@ -1,4 +1,49 @@
import { Controller } from "@nestjs/common";
import { Body, Controller, Post } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { AuthService } from "./auth.service";
import { CompleteRegistrationDto } from "./DTO/complete-register.dto";
import { RequestOtpDto } from "./DTO/request-otp.dto";
@ApiTags("Auth")
@Controller("auth")
export class AuthController {}
export class AuthController {
constructor(private authService: AuthService) {}
@ApiOperation({ summary: "Initiate registration" })
@Post("register/initiate")
async register(@Body() registerDto: RequestOtpDto) {
return this.authService.initiateRegistration(registerDto);
}
@ApiOperation({ summary: "complete registration ==> step 2" })
@Post("register/complete")
async completeRegistration(@Body() completeRegistrationDto: CompleteRegistrationDto) {
return this.authService.completeRegistration(completeRegistrationDto);
}
// @Post("login")
// async login(@Body() loginDto: LoginDto) {
// return this.authService.login(loginDto);
// }
// @Post("otp/register/send")
// async sendOtp(@Body() sendOtpDto: RequestOtpDto) {
// return this.authService.requestRegisterOTP(sendOtpDto);
// }
// @Post("otp/verify")
// async verifyOtp(@Body() verifyOtpDto: VerifyOtpDto) {
// return this.authService.verifyOtp(verifyOtpDto);
// }
// @Post("forgot-password")
// async forgotPassword(@Body() forgotPasswordDto: ForgotPasswordDto) {
// return this.authService.forgotPassword(forgotPasswordDto);
// }
// @Post("reset-password")
// async resetPassword(@Body() resetPasswordDto: ResetPasswordDto) {
// return this.authService.resetPassword(resetPasswordDto);
// }
}