From e0b73bab995a83905f90070fb3d58c3310c9cda3 Mon Sep 17 00:00:00 2001 From: seungnYong <77851079+gkfktkrh153@users.noreply.github.com> Date: Mon, 9 Oct 2023 02:42:18 +0900 Subject: [PATCH] Update JwtAuthenticationFilter.java --- .../com/festival/common/security/JwtAuthenticationFilter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/festival/common/security/JwtAuthenticationFilter.java b/src/main/java/com/festival/common/security/JwtAuthenticationFilter.java index b0ee8bd..f43145e 100644 --- a/src/main/java/com/festival/common/security/JwtAuthenticationFilter.java +++ b/src/main/java/com/festival/common/security/JwtAuthenticationFilter.java @@ -35,6 +35,10 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { ObjectMapper objectMapper = new ObjectMapper(); try { + if (request.getMethod().equals("OPTIONS")) { + filterChain.doFilter(request, response); + } + String accessToken = JwtTokenUtils.extractBearerToken(request.getHeader("accessToken")); if (!request.getRequestURI().equals("/api/v2/member/rotate") && accessToken != null) { // 토큰 재발급의 요청이 아니면서 accessToken이 존재할 때