Skip to content

Commit

Permalink
[fix] 리프레쉬 토큰 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Feb 20, 2024
1 parent 04e30ef commit 5bb4ca3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ public MemberReissueTokenResponseDto reissue(MemberTokenResponseDto memberTokenR

String refreshToken = memberTokenResponseDto.refreshToken();
String redisKey = "RT:" + memberId;
String storedRefreshToken = redisTemplate.opsForValue().get(redisKey);
jwtProvider.validateRefreshToken(storedRefreshToken);
jwtProvider.equalsRefreshToken(refreshToken, storedRefreshToken);

jwtProvider.validateRefreshToken(refreshToken);
String newAccessToken = issueNewAccessToken(memberId);
String newRefreshToken = issueNewRefreshToken(memberId);
redisTemplate.opsForValue().set(redisKey, newRefreshToken, REFRESH_TOKEN_EXPIRE_TIME, TimeUnit.SECONDS);

String storedRefreshToken = redisTemplate.opsForValue().get(redisKey);
jwtProvider.equalsRefreshToken(newRefreshToken, storedRefreshToken);

return MemberReissueTokenResponseDto.of(newAccessToken, newRefreshToken);
}

Expand Down

0 comments on commit 5bb4ca3

Please sign in to comment.