mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
feat: finialize creating juniors
This commit is contained in:
@ -9,9 +9,11 @@ import {
|
||||
ChangePasswordRequestDto,
|
||||
CreateUnverifiedUserRequestDto,
|
||||
ForgetPasswordRequestDto,
|
||||
JuniorLoginRequestDto,
|
||||
LoginRequestDto,
|
||||
RefreshTokenRequestDto,
|
||||
SendForgetPasswordOtpRequestDto,
|
||||
setJuniorPasswordRequestDto,
|
||||
VerifyForgetPasswordOtpRequestDto,
|
||||
VerifyUserRequestDto,
|
||||
} from '../dtos/request';
|
||||
@ -69,10 +71,26 @@ export class AuthController {
|
||||
@Post('change-password')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@UseGuards(AccessTokenGuard)
|
||||
async changePassword(@AuthenticatedUser() { sub }: IJwtPayload, @Body() forgetPasswordDto: ChangePasswordRequestDto) {
|
||||
changePassword(@AuthenticatedUser() { sub }: IJwtPayload, @Body() forgetPasswordDto: ChangePasswordRequestDto) {
|
||||
return this.authService.changePassword(sub, forgetPasswordDto);
|
||||
}
|
||||
|
||||
@Post('junior/set-password')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Public()
|
||||
setJuniorPasscode(@Body() setPassworddto: setJuniorPasswordRequestDto) {
|
||||
return this.authService.setJuniorPassword(setPassworddto);
|
||||
}
|
||||
|
||||
@Post('junior/login')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiDataResponse(LoginResponseDto)
|
||||
async juniorLogin(@Body() juniorLoginDto: JuniorLoginRequestDto) {
|
||||
const [res, user] = await this.authService.juniorLogin(juniorLoginDto);
|
||||
|
||||
return ResponseFactory.data(new LoginResponseDto(res, user));
|
||||
}
|
||||
|
||||
@Post('refresh-token')
|
||||
@Public()
|
||||
async refreshToken(@Body() { refreshToken }: RefreshTokenRequestDto) {
|
||||
|
||||
Reference in New Issue
Block a user