tidy up
This commit is contained in:
parent
b5c850d178
commit
4f8d54ebd6
|
@ -41,9 +41,9 @@ export class AuthController {
|
||||||
description: 'User signin successfully',
|
description: 'User signin successfully',
|
||||||
type: LoginResponseDto,
|
type: LoginResponseDto,
|
||||||
})
|
})
|
||||||
|
@HttpCode(HttpStatus.OK)
|
||||||
@Public()
|
@Public()
|
||||||
@Post('signin')
|
@Post('signin')
|
||||||
@HttpCode(HttpStatus.OK)
|
|
||||||
public async signin(
|
public async signin(
|
||||||
@Res({ passthrough: true }) response: Response,
|
@Res({ passthrough: true }) response: Response,
|
||||||
@Req() request: Request,
|
@Req() request: Request,
|
||||||
|
@ -52,6 +52,11 @@ export class AuthController {
|
||||||
return await this.authService.signin(userCredentials, response, request);
|
return await this.authService.signin(userCredentials, response, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiCreatedResponse({
|
||||||
|
description: 'User tokens refreshed successfully',
|
||||||
|
type: AccessTokenDto,
|
||||||
|
})
|
||||||
|
@HttpCode(HttpStatus.OK)
|
||||||
@Public()
|
@Public()
|
||||||
@Post('refresh')
|
@Post('refresh')
|
||||||
public async refreshToken(@Req() request: Request): Promise<AccessTokenDto> {
|
public async refreshToken(@Req() request: Request): Promise<AccessTokenDto> {
|
||||||
|
@ -62,48 +67,9 @@ export class AuthController {
|
||||||
description: 'User signed out successfully',
|
description: 'User signed out successfully',
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
})
|
})
|
||||||
@Post('logout')
|
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
|
@Post('logout')
|
||||||
public async logout(@GetCurrentUserId() userId: string): Promise<boolean> {
|
public async logout(@GetCurrentUserId() userId: string): Promise<boolean> {
|
||||||
return this.authService.logout(userId);
|
return this.authService.logout(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiHeader({
|
|
||||||
// name: 'Authorization',
|
|
||||||
// required: true,
|
|
||||||
// schema: {
|
|
||||||
// example: 'Bearer <refresh_token>',
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
// @ApiCreatedResponse({
|
|
||||||
// description: 'User tokens refreshed successfully',
|
|
||||||
// type: TokensDto,
|
|
||||||
// })
|
|
||||||
// @Public()
|
|
||||||
// @UseGuards(RefreshTokenGuard)
|
|
||||||
// @Post('refresh')
|
|
||||||
// @HttpCode(HttpStatus.OK)
|
|
||||||
// public async refresh(
|
|
||||||
// @GetCurrentUserId() userId: string,
|
|
||||||
// @GetCurrentUser('refresh_token') refresh_token: string
|
|
||||||
// ): Promise<TokensDto> {
|
|
||||||
// return this.authService.refresh(userId, refresh_token);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @ApiHeader({
|
|
||||||
// name: 'Authorization',
|
|
||||||
// required: true,
|
|
||||||
// schema: {
|
|
||||||
// example: 'Bearer <access_token>',
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
// @ApiCreatedResponse({
|
|
||||||
// description: 'Token validity checked successfully',
|
|
||||||
// type: Boolean,
|
|
||||||
// })
|
|
||||||
// @Post('check-token')
|
|
||||||
// @HttpCode(HttpStatus.OK)
|
|
||||||
// public checkTokenValidity(): Promise<boolean> {
|
|
||||||
// return this.authService.checkTokenValidity();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue