diff --git a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java index 12ffd5653..8e078b50c 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java @@ -8,6 +8,7 @@ import java.util.Iterator; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpMethod; import org.springframework.web.servlet.HandlerInterceptor; @RequiredArgsConstructor @@ -31,6 +32,22 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons log.info("authorization - {}", authorization); log.info("accessToken - {}", accessToken); + log.info("Method - {}", request.getMethod()); + if (request.getMethod().equals(HttpMethod.OPTIONS.name())) { + return true; + } + + Iterator headerNames = request.getHeaderNames().asIterator(); + while ((headerNames.hasNext())) { + String next = headerNames.next(); + String header = request.getHeader(next); + log.info("{} header - {}", next, header); + } + + log.info("bearer - {}", request.getHeader("Bearer")); + log.info("authorization - {}", authorization); + log.info("accessToken - {}", accessToken); + if (accessToken == null) { throw new UnauthorizedException(); }