chore: add register of user
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user