From 93c00d6eac82ff7948df948e84fa8470488803ac Mon Sep 17 00:00:00 2001 From: baeksom <97323941+baeksom@users.noreply.github.com> Date: Mon, 27 May 2024 02:03:31 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20[BUGFIX]:=20=EB=8F=99=EC=8B=9C?= =?UTF-8?q?=EC=A0=91=EC=86=8D=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/security/filter/JwtExceptionFilter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtExceptionFilter.java b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtExceptionFilter.java index 5ff732a..1a1570e 100644 --- a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtExceptionFilter.java +++ b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtExceptionFilter.java @@ -1,5 +1,8 @@ package KGUcapstone.OutDecision.global.security.filter; +import KGUcapstone.OutDecision.domain.user.service.auth.TokenService; +import KGUcapstone.OutDecision.global.common.util.CookieUtil; +import KGUcapstone.OutDecision.global.common.util.JwtUtil; import KGUcapstone.OutDecision.global.error.exception.ApiResponse; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.FilterChain; @@ -15,6 +18,8 @@ import java.io.IOException; +import static KGUcapstone.OutDecision.global.common.util.CookieUtil.deleteCookie; + @Slf4j @RequiredArgsConstructor @Component @@ -33,6 +38,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response.setContentType(MediaType.APPLICATION_JSON_VALUE); response.setCharacterEncoding("UTF-8"); objectMapper.writeValue(response.getWriter(), ApiResponse.onFailure("401",e.getMessage(),null)); + deleteCookie(response, "Authorization"); } } }