diff --git a/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java b/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java index 943dd2a09..36696793d 100644 --- a/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java +++ b/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java @@ -19,9 +19,12 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { "/health-check", "/auth/kakao/callback", "/categories/guest", - "/swagger-ui.html", - "/v3/api-docs/**", - "/swagger-ui/**" + "/swagger-ui.html" + ); + + private static final List ALLOWED_START_URIS = List.of( + "/v3/api-docs", + "/swagger-ui" ); private final TokenProcessor tokenProcessor; @@ -40,8 +43,8 @@ protected void doFilterInternal( @Override protected boolean shouldNotFilter(final HttpServletRequest request) { - return ALLOWED_URIS.stream() - .anyMatch(url -> request.getRequestURI().contains(url)); + return ALLOWED_URIS.stream().anyMatch(url -> request.getRequestURI().contains(url)) + || ALLOWED_START_URIS.stream().anyMatch(url -> request.getRequestURI().startsWith(url)); } }