Skip to content

Commit

Permalink
refactor(#10): 카카오 로그아웃 명세서 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoDora committed Oct 12, 2023
1 parent 15198f0 commit 72c133c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/auth/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export class AuthController {
return res.json({ accessToken: newAccessToken });
}

@ApiOperation({ summary: '카카오 로그아웃 API', description: '카카오 로그아웃 API' })
@ApiResponse({ status: 201, description: '성공적으로 로그아웃 된 경우', content: { JSON: { example: { message: "카카오 로그아웃이 완료되었습니다." } } } })
@ApiResponse({ status: 403, description: '만료된 액세스 토큰인 경우', content: { JSON: { example: { statusCode: 403, message: '만료된 토큰입니다.' } } } })
@Post('kakao/logout')
async kakaoLogout(@Headers('access_token') accessToken: string) {
const userId = await this.tokenService.decodeToken(accessToken);
Expand Down
2 changes: 1 addition & 1 deletion src/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class AuthService {
};

axios.post(kakaoLogoutUrl, {}, kakaoLogoutHeader);
return { status: true, message: "카카오 로그아웃이 완료되었습니다." };
return { message: "카카오 로그아웃이 완료되었습니다." };
}

async kakaoUnlink(accessToken: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/services/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class TokenService {
return (await axios.get(kakaoUnlinkUrl, kakaoUnlinkHeader)).status;
} catch (error) {
console.error('카카오 토큰 유효성 검사 오류:', error);
return false;
throw new HttpException('카카오 토큰 유효성 검사 오류', HttpStatus.FORBIDDEN);
}
}

Expand Down

0 comments on commit 72c133c

Please sign in to comment.