Skip to content

Commit

Permalink
hotfix : 리프레쉬 토큰 없을 때 로그아웃 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
oosedus committed Nov 15, 2024
1 parent 91a8cc8 commit b7db242
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ private void deleteTokenCookies(HttpServletResponse response) {
}

private void deleteRefreshTokenInRedis(HttpServletRequest request) {
String refreshToken = cookieUtil.getCookieValue(request, "refreshToken");
if (refreshToken == null || refreshToken.isEmpty()) {
log.info("쿠키에 리프레쉬 토큰 없음");
return;
}
Optional<RefreshToken> refreshTokenOptional = refreshTokenRepository.findByRefreshToken(cookieUtil.getCookieValue(request, "refreshToken"));
refreshTokenOptional.ifPresent(refreshTokenRepository::delete);
}
Expand Down

0 comments on commit b7db242

Please sign in to comment.