From f6021122dd0a77587596bc429f1bbd04b316c59a Mon Sep 17 00:00:00 2001 From: koungq Date: Tue, 20 Aug 2024 19:32:28 +0900 Subject: [PATCH] =?UTF-8?q?Hotfix:=20JWT=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/jwt/filter/JwtAuthenticationProcessingFilter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) {