Skip to content

Commit

Permalink
✨ 기능 수정 : jwtfilter 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JoJeHuni committed Nov 30, 2024
1 parent 16dc752 commit cd490c7
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class JwtFilter extends OncePerRequestFilter {
private final AdminService userService;
private final JwtUtil jwtUtil; // JWT 토큰을 다루는 JwtUtil 클래스
private final List<String> excludeUrl // JWT 토큰 검증을 제외할 URL 패턴 목록
= Arrays.asList("/admin/verification-email/**"
= Arrays.asList("/admin/verification-email/**", "/actuator/health"
, "/admin/verification-email/password", "/swagger-ui.html", "/swagger-ui/index.html"
, "/admin/password");

Expand All @@ -42,19 +42,14 @@ protected boolean shouldNotFilter(HttpServletRequest request) throws ServletExce
// JWT 토큰을 검사하고 인증을 처리하는 실제 필터 로직. 만약 유효한 JWT 토큰이 있다면 인증을 처리하고, 없으면 다음 필터로 진행.

@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {

log.info("JwtFilter 실행 - 쿠키에서 토큰 추출 시도");

protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
// 쿠키에서 토큰 가져오기
String token = null;
if (request.getCookies() != null) {
for (Cookie cookie : request.getCookies()) {
log.info("쿠키 이름: {}, 쿠키 값: {}", cookie.getName(), cookie.getValue());
if ("token".equals(cookie.getName())) {
token = cookie.getValue();
log.info("추출된 토큰: {}", token);
break;
}
}
Expand Down

0 comments on commit cd490c7

Please sign in to comment.