diff --git a/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtAuthenticationFilter.java b/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtAuthenticationFilter.java index a7b4ca19..1509b8a5 100644 --- a/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtAuthenticationFilter.java +++ b/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtAuthenticationFilter.java @@ -38,17 +38,16 @@ protected void doFilterInternal(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain) { try { + log.info("Request method: {}", servletRequest.getMethod()); + log.info("Request path: {}", servletRequest.getRequestURI()); String token = jwtTokenProvider.getToken(servletRequest); if (token != null) { jwtTokenProvider.validateToken(token); - log.info(String.valueOf(1)); Authentication authentication = jwtTokenProvider.getAuthentication(token); - log.info(String.valueOf(2)); SecurityContextHolder.getContext().setAuthentication(authentication); - log.info(String.valueOf(3)); } }catch (IllegalArgumentException e) { // 예외 처리: Invalid access token header diff --git a/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtTokenProvider.java b/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtTokenProvider.java index 11934cf5..7f094875 100644 --- a/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtTokenProvider.java +++ b/src/main/java/com/modernfarmer/farmusspring/global/common/security/JwtTokenProvider.java @@ -109,19 +109,13 @@ public String getSocialToken(HttpServletRequest request) { } public Long getUserId(String token) { - log.info("[resolveToken] HTTP 헤더에서 Token 값 추출"); - String info = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token).getBody() .getSubject(); - Long userId = Long.valueOf(info); - - return userId; - + return Long.valueOf(info); } public boolean validateToken(String token) { // 토큰 유효성 확인 - log.info("[validateToken] 토큰 유효 체크 시작"); Jws claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token); log.info("[validateToken] 토큰 유효 체크 완료"); return true;