mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 17:14:55 +00:00
feat: handle google login
This commit is contained in:
@ -16,6 +16,7 @@ import {
|
||||
SetEmailRequestDto,
|
||||
setJuniorPasswordRequestDto,
|
||||
SetPasscodeRequestDto,
|
||||
VerifyOtpRequestDto,
|
||||
VerifyUserRequestDto,
|
||||
} from '../dtos/request';
|
||||
import { SendForgetPasswordOtpResponseDto, SendRegisterOtpResponseDto } from '../dtos/response';
|
||||
@ -54,6 +55,23 @@ 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/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)
|
||||
@UseGuards(AccessTokenGuard)
|
||||
|
||||
Reference in New Issue
Block a user