From ef7622bfda570f3bdaa9962452e323e82a50308e Mon Sep 17 00:00:00 2001 From: baeksom <97323941+baeksom@users.noreply.github.com> Date: Sun, 26 May 2024 20:19:06 +0900 Subject: [PATCH] =?UTF-8?q?[UPDATE]:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/security/filter/JwtAuthFilter.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java index 4117468..cee2ce9 100644 --- a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java +++ b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java @@ -23,8 +23,6 @@ import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import static KGUcapstone.OutDecision.global.common.util.CookieUtil.addCookie; @@ -61,25 +59,9 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse if (newAccessToken != null) { addCookie(response, "Authorization", newAccessToken, 60 * 60); - atc = newAccessToken; log.info("토큰 발급 완료 필터 newAccessToken = {}", newAccessToken); - // 원래 요청을 재시도 - HttpServletRequestWrapper requestWrapper = new HttpServletRequestWrapper(request) { - @Override - public Cookie[] getCookies() { - Cookie[] cookies = super.getCookies(); - if (cookies == null) { - cookies = new Cookie[0]; - } - List updatedCookies = new ArrayList<>(Arrays.asList(cookies)); - updatedCookies.removeIf(cookie -> "Authorization".equals(cookie.getName())); - updatedCookies.add(new Cookie("Authorization", newAccessToken)); - return updatedCookies.toArray(new Cookie[0]); - } - }; - - filterChain.doFilter(requestWrapper, response); + filterChain.doFilter(request, response); return; } else { log.error("새로운 토큰 발급 실패");