add spaces

This commit is contained in:
xds
2025-02-17 17:58:07 +03:00
parent a5b334f6c2
commit d680345a9f
23 changed files with 1097 additions and 285 deletions

View File

@@ -26,7 +26,7 @@ class BearerTokenFilter(private val authService: AuthService) : SecurityContextS
override fun filter(exchange: ServerWebExchange, chain: WebFilterChain): Mono<Void> {
val token = exchange.request.headers.getFirst(HttpHeaders.AUTHORIZATION)?.removePrefix("Bearer ")
if (exchange.request.path.value() == "/api/auth/login" || exchange.request.path.value()
if (exchange.request.path.value() in listOf("/api/auth/login","/api/auth/register") || exchange.request.path.value()
.startsWith("/api/actuator")
) {
return chain.filter(exchange)

View File

@@ -25,7 +25,7 @@ class SecurityConfig(
.logout { it.disable() }
.authorizeExchange {
it.pathMatchers(HttpMethod.POST, "/auth/login").permitAll()
it.pathMatchers(HttpMethod.POST, "/auth/login", "/auth/register").permitAll()
it.pathMatchers("/actuator/**").permitAll()
it.anyExchange().authenticated()
}