mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
feat: handle new registration flow
This commit is contained in:
@ -18,7 +18,6 @@ import {
|
||||
setJuniorPasswordRequestDto,
|
||||
SetPasscodeRequestDto,
|
||||
VerifyLoginOtpRequestDto,
|
||||
VerifyOtpRequestDto,
|
||||
VerifyUserRequestDto,
|
||||
} from '../dtos/request';
|
||||
import { SendForgetPasswordOtpResponseDto, SendRegisterOtpResponseDto } from '../dtos/response';
|
||||
@ -72,22 +71,22 @@ export class AuthController {
|
||||
await this.authService.setPasscode(sub, passcode);
|
||||
}
|
||||
|
||||
@Post('register/set-phone/otp')
|
||||
@UseGuards(AccessTokenGuard)
|
||||
async setPhoneNumber(
|
||||
@AuthenticatedUser() { sub }: IJwtPayload,
|
||||
@Body() setPhoneNumberDto: CreateUnverifiedUserRequestDto,
|
||||
) {
|
||||
const phoneNumber = await this.authService.setPhoneNumber(sub, setPhoneNumberDto);
|
||||
return ResponseFactory.data(new SendRegisterOtpResponseDto(phoneNumber));
|
||||
}
|
||||
// @Post('register/set-phone/otp')
|
||||
// @UseGuards(AccessTokenGuard)
|
||||
// async setPhoneNumber(
|
||||
// @AuthenticatedUser() { sub }: IJwtPayload,
|
||||
// @Body() setPhoneNumberDto: CreateUnverifiedUserRequestDto,
|
||||
// ) {
|
||||
// const phoneNumber = await this.authService.setPhoneNumber(sub, setPhoneNumberDto);
|
||||
// return ResponseFactory.data(new SendRegisterOtpResponseDto(phoneNumber));
|
||||
// }
|
||||
|
||||
@Post('register/set-phone/verify')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@UseGuards(AccessTokenGuard)
|
||||
async verifyPhoneNumber(@AuthenticatedUser() { sub }: IJwtPayload, @Body() { otp }: VerifyOtpRequestDto) {
|
||||
await this.authService.verifyPhoneNumber(sub, otp);
|
||||
}
|
||||
// @Post('register/set-phone/verify')
|
||||
// @HttpCode(HttpStatus.NO_CONTENT)
|
||||
// @UseGuards(AccessTokenGuard)
|
||||
// async verifyPhoneNumber(@AuthenticatedUser() { sub }: IJwtPayload, @Body() { otp }: VerifyOtpRequestDto) {
|
||||
// await this.authService.verifyPhoneNumber(sub, otp);
|
||||
// }
|
||||
|
||||
@Post('biometric/enable')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
|
||||
Reference in New Issue
Block a user