diff --git a/src/main/java/leets/weeth/global/auth/jwt/filter/JwtAuthenticationProcessingFilter.java b/src/main/java/leets/weeth/global/auth/jwt/filter/JwtAuthenticationProcessingFilter.java index 948bc2eb..5dd0da84 100644 --- a/src/main/java/leets/weeth/global/auth/jwt/filter/JwtAuthenticationProcessingFilter.java +++ b/src/main/java/leets/weeth/global/auth/jwt/filter/JwtAuthenticationProcessingFilter.java @@ -57,15 +57,16 @@ public void checkAccessTokenAndRefreshToken(HttpServletRequest request, HttpServ .filter(jwtService::isTokenValid) .orElse(null); - if (accessToken == null) { - checkRefreshTokenAndReIssueAccessToken(response, refreshToken); - } else { + if (accessToken != null) { jwtService.extractEmail(accessToken) .ifPresent(email -> userRepository.findByEmail(email) .ifPresent(this::saveAuthentication)); filterChain.doFilter(request, response); } + + checkRefreshTokenAndReIssueAccessToken(response, refreshToken); + } public void checkRefreshTokenAndReIssueAccessToken(HttpServletResponse response, String refreshToken) {