Skip to content

Commit

Permalink
🎨 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jafacode committed Jan 20, 2025
1 parent 1016409 commit d2ac9ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import org.springframework.security.web.authentication.WebAuthenticationDetailsS
import org.springframework.security.web.util.matcher.AntPathRequestMatcher
import org.springframework.stereotype.Component
import org.springframework.web.filter.OncePerRequestFilter

@Component
class JwtAuthenticationFilter(
private val userService: UserService,
) : OncePerRequestFilter() {
private val excludedPaths = SecurityConstants.PUBLIC_PATHS.map { AntPathRequestMatcher(it) }

override fun doFilterInternal(
request: HttpServletRequest,
response: HttpServletResponse,
Expand Down Expand Up @@ -56,7 +58,8 @@ class JwtAuthenticationFilter(
}
filterChain.doFilter(request, response)
}

private fun isExcluded(request: HttpServletRequest): Boolean {
return excludedPaths.any { it.matches(request) }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ data class UserPrincipal(
override fun isCredentialsNonExpired(): Boolean = true

override fun isEnabled(): Boolean = true
}
}

0 comments on commit d2ac9ea

Please sign in to comment.