Skip to content

Commit

Permalink
update status codes for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekedani committed May 30, 2024
1 parent f0cb9d2 commit f487d1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions users/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Body,
Controller,
Get,
HttpCode,
Post,
Request,
UseGuards,
Expand All @@ -21,16 +22,19 @@ export class AuthController {
}

@Post('login')
@HttpCode(200)
async login(@Body() loginDto: LoginDto) {
return this.authService.login(loginDto);
}

@Post('refresh')
@HttpCode(200)
async refresh(@Body() body: { refreshToken: string }) {
return this.authService.refresh(body.refreshToken);
}

@Post('logout')
@HttpCode(200)
@UseGuards(JwtAuthGuard)
async logout(@Request() req: any) {
return this.authService.logout(req.user?.id);
Expand Down

0 comments on commit f487d1a

Please sign in to comment.