From dbb60baf77f1ce0e9b2f6a56d5d4ddaf687d6720 Mon Sep 17 00:00:00 2001 From: min-96 Date: Mon, 27 May 2024 18:20:18 +0900 Subject: [PATCH] fix: ignore path --- src/main/kotlin/com/api/auth/config/SecurityConfig.kt | 2 -- .../com/api/auth/security/RefreshTokenValidationFilter.kt | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/api/auth/config/SecurityConfig.kt b/src/main/kotlin/com/api/auth/config/SecurityConfig.kt index 9415914..e9de21d 100644 --- a/src/main/kotlin/com/api/auth/config/SecurityConfig.kt +++ b/src/main/kotlin/com/api/auth/config/SecurityConfig.kt @@ -18,8 +18,6 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic class SecurityConfig( private val refreshTokenValidationFilter: RefreshTokenValidationFilter ) { - - @Bean fun webSecurityCustomizer(): WebSecurityCustomizer { return WebSecurityCustomizer { web: WebSecurity -> web.ignoring().requestMatchers("/v1/auth") } diff --git a/src/main/kotlin/com/api/auth/security/RefreshTokenValidationFilter.kt b/src/main/kotlin/com/api/auth/security/RefreshTokenValidationFilter.kt index 9807371..4c302cb 100644 --- a/src/main/kotlin/com/api/auth/security/RefreshTokenValidationFilter.kt +++ b/src/main/kotlin/com/api/auth/security/RefreshTokenValidationFilter.kt @@ -18,6 +18,11 @@ class RefreshTokenValidationFilter( response: HttpServletResponse, filterChain: FilterChain ) { + + if (request.requestURI.equals("/v1/auth", ignoreCase = true)) { + filterChain.doFilter(request, response) + return + } val refreshToken = request.getHeader("Authorization")?.substring("Bearer ".length) if (refreshToken != null && jwtProvider.validateToken(refreshToken)) { val address = jwtProvider.getClaimsFromToken(refreshToken)?.getClaim("address")