Skip to content

Commit f4ba8f8

Browse files
committed
refactor: swagger 필터 우회 하게 수정
1 parent c660db3 commit f4ba8f8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/example/log4u/common/oauth2/jwt/JwtAuthenticationFilter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ protected void doFilterInternal(
6060
}
6161

6262
private boolean shouldSkipFilter(String requestUri) {
63-
return requestUri.matches("^/login(/.*)?$") || requestUri.matches("^/oauth2(/.*)?$");
63+
return requestUri.matches("^/login(/.*)?$")
64+
|| requestUri.matches("^/oauth2(/.*)?$")
65+
|| requestUri.matches("^/swagger-ui(/.*)?$");
6466
}
6567

6668
private String extractAccessTokenFromCookie(HttpServletRequest request) {

src/main/java/com/example/log4u/common/oauth2/jwt/JwtLogoutFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void doFilter(
6565

6666
private boolean shouldSkipFilter(String requestUri) {
6767
// logout 검사
68-
return !requestUri.matches("^\\/logout$");
68+
return !requestUri.matches("^\\/logout$")
69+
|| requestUri.matches("^/swagger-ui(/.*)?$");
6970
}
7071

7172
private boolean validateTokenExpiration(

0 commit comments

Comments
 (0)