Skip to content

Conversation

@DuFong
Copy link
Collaborator

@DuFong DuFong commented Feb 25, 2025

Jira: YP-688

💡 유형

  • 새로운 기능 추가
  • 코드 리팩토링

💁 해결하려는 문제를 적어주세요

  • 서버측 로그아웃 API 추가하였습니다.

🤔 어떤 방식으로 해결했는지 적어주세요

  • 로그아웃 API 요청시 DB에 저장되어 있는 Refresh Token 삭제 및 클라이언트의 Refresh Token 쿠키를 제거합니다.

🙋 중점적으로 리뷰 했으면 하는 부분이 있다면 적어주세요

🧑‍🏫 이해를 위해 필요한 자료가 있다면 첨부해주세요

@DuFong DuFong requested review from 05AM and removed request for 05AM February 25, 2025 04:04
@DuFong DuFong requested a review from 05AM May 22, 2025 09:36
@DuFong DuFong added the D-3 3일 전 까지 리뷰해주세요 label May 22, 2025
@github-actions github-actions bot added D-2 2일 전 까지 리뷰해주세요 D-1 1일 전 까지 리뷰해주세요 D-0 바로 리뷰가 필요해요 and removed D-3 3일 전 까지 리뷰해주세요 D-2 2일 전 까지 리뷰해주세요 D-1 1일 전 까지 리뷰해주세요 labels May 22, 2025
Comment on lines +159 to +177
/**
* 쿠키에서 Refresh Token 추출
*/
private String extractRefreshTokenFromCookies(HttpServletRequest request) {
if (request.getCookies() == null) return "";

return Arrays.stream(request.getCookies())
.filter(cookie -> REFRESH_TOKEN_COOKIE_NAME.equals(cookie.getName()))
.map(Cookie::getValue)
.findFirst()
.orElse("");
}

/**
* 토큰 유효성 검사
*/
private boolean isTokenInvalid(String token) {
return !StringUtils.hasText(token);
}
Copy link
Contributor

@05AM 05AM May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: 관련 메서드들이 컨트롤러가 아닌 관련 서비스(ex. RefreshTokenService 등) 에서 구현되어 기능이 분리되면 좋을 것 같습니다!

}

public void logout(String refreshToken) {
Long memberId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P4: 로그아웃 로직에서 member id를 따로 빼신 이유가 있을까요?

Copy link
Contributor

@05AM 05AM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 리뷰 확인 부탁 드립니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

D-0 바로 리뷰가 필요해요

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants