Skip to content

Commit

Permalink
feat : "재 로그인시 기존 Refresh Token update"
Browse files Browse the repository at this point in the history
  • Loading branch information
ddglackrp committed Dec 4, 2024
1 parent 5980641 commit e657897
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo

Optional<RefreshToken> findRefreshToken = refreshTokenService.findRefreshToken(customUserDetails.getMember().getId());

String refreshToken = null;
String refreshToken = jwtUtil.generateRefreshToken(uuid, role);

if (findRefreshToken.isEmpty()) {
refreshToken = jwtUtil.generateRefreshToken(uuid, role);
refreshTokenService.addRefreshEntity(refreshToken, uuid, jwtUtil.getRefreshExpiredTime());
} else {
refreshToken = findRefreshToken.get().getToken();
refreshTokenService.renewalRefreshToken(findRefreshToken.get().getToken(), refreshToken, jwtUtil.getRefreshExpiredTime());
}

String accessToken = jwtUtil.generateAccessToken(uuid, role);
Expand Down

0 comments on commit e657897

Please sign in to comment.