Skip to content

Commit

Permalink
fix: ignore path
Browse files Browse the repository at this point in the history
  • Loading branch information
min-96 committed May 27, 2024
1 parent 6117d96 commit dbb60ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/kotlin/com/api/auth/config/SecurityConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit dbb60ba

Please sign in to comment.