-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from boostcampwm-2024/be/feature/logout
[feat] 로그아웃 구현
- Loading branch information
Showing
9 changed files
with
130 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { ApiResponse } from '@nestjs/swagger'; | ||
import { | ||
LogoutFailure400ResponseDto, | ||
LogoutFailure401ResponseDto, | ||
LogoutSuccessResponseDto | ||
} from '../dto/logout.dto'; | ||
|
||
export function logoutResponseDecorator() { | ||
return applyDecorators( | ||
ApiResponse({ | ||
status: 200, | ||
description: '로그아웃 성공', | ||
type: LogoutSuccessResponseDto | ||
}), | ||
ApiResponse({ | ||
status: 400, | ||
description: '토큰 없음', | ||
type: LogoutFailure400ResponseDto | ||
}), | ||
ApiResponse({ | ||
status: 401, | ||
description: '만료된 토큰', | ||
type: LogoutFailure401ResponseDto | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class LogoutSuccessResponseDto { | ||
@ApiProperty({ | ||
description: '응답 코드', | ||
example: 200 | ||
}) | ||
code: number; | ||
|
||
@ApiProperty({ | ||
description: '응답 메세지', | ||
example: '로그아웃 되었습니다.' | ||
}) | ||
message: string; | ||
} | ||
|
||
export class LogoutFailure400ResponseDto { | ||
@ApiProperty({ | ||
description: '응답 코드', | ||
example: 400 | ||
}) | ||
code: number; | ||
|
||
@ApiProperty({ | ||
description: '응답 메세지', | ||
example: '토큰이 필요합니다.' | ||
}) | ||
message: string; | ||
} | ||
|
||
export class LogoutFailure401ResponseDto { | ||
@ApiProperty({ | ||
description: '응답 코드', | ||
example: 401 | ||
}) | ||
code: number; | ||
|
||
@ApiProperty({ | ||
description: '응답 메세지', | ||
example: '유효하지 않은 토큰입니다.' | ||
}) | ||
message: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.