로그아웃 수정, 패스워드 변경 수정
This commit is contained in:
@@ -11,6 +11,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
@Component
|
||||
@@ -19,6 +20,10 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
private final JwtTokenProvider jwtTokenProvider;
|
||||
private final UserDetailsService userDetailsService;
|
||||
private static final AntPathMatcher PATH_MATCHER = new AntPathMatcher();
|
||||
private static final String[] EXCLUDE_PATHS = {
|
||||
"/api/auth/signin", "/api/auth/refresh", "/api/auth/logout", "/api/members/*/password"
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(
|
||||
@@ -44,10 +49,12 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
String path = request.getServletPath();
|
||||
|
||||
// JWT 필터를 타지 않게 할 URL 패턴들
|
||||
return path.startsWith("/api/auth/signin")
|
||||
|| path.startsWith("/api/auth/refresh")
|
||||
|| path.startsWith("/api/auth/logout")
|
||||
|| path.startsWith("/api/members/*/password");
|
||||
for (String pattern : EXCLUDE_PATHS) {
|
||||
if (PATH_MATCHER.match(pattern, path)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// /api/members/{memberId}/password
|
||||
|
||||
Reference in New Issue
Block a user