From 98e062fff541409394000f8293ca18016785b717 Mon Sep 17 00:00:00 2001 From: kimnamgyu Date: Mon, 25 Nov 2024 19:04:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=EC=9A=94=EC=B2=AD=20=EC=8B=9C=20?= =?UTF-8?q?=EB=AC=B4=EC=A1=B0=EA=B1=B4=20200=20=EC=9D=91=EB=8B=B5=EC=9D=84?= =?UTF-8?q?=20=EB=BF=8C=EB=A6=AC=EB=8A=94=20=EC=98=A4=EB=A5=98=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 --- .../capsbe/global/jwt/JwtAuthenticationFilter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/syu/capsbe/global/jwt/JwtAuthenticationFilter.java b/src/main/java/com/syu/capsbe/global/jwt/JwtAuthenticationFilter.java index 605ccb9..1df30e2 100644 --- a/src/main/java/com/syu/capsbe/global/jwt/JwtAuthenticationFilter.java +++ b/src/main/java/com/syu/capsbe/global/jwt/JwtAuthenticationFilter.java @@ -16,20 +16,21 @@ public class JwtAuthenticationFilter extends GenericFilterBean { private static final String AUTHORIZATION_HEADER = "Authorization"; - private static final String TOKEN_PREFIX = "Bearer "; - private final JwtProvider jwtProvider; + private static final String TOKEN_PREFIX = "Bearer"; + private final JwtProvider jwtTokenProvider; @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String token = resolveToken((HttpServletRequest) request); - if (token != null && jwtProvider.validateToken(token)) { - Authentication authentication = jwtProvider.getAuthentication(token); + if (token != null && jwtTokenProvider.validateToken(token)) { + Authentication authentication = jwtTokenProvider.getAuthentication(token); SecurityContextHolder.getContext().setAuthentication(authentication); - chain.doFilter(request, response); } + + chain.doFilter(request, response); } private String resolveToken(HttpServletRequest request) {