mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-27 06:12:27 +00:00
Polish AuthenticationWebFilter
Code style
This commit is contained in:
parent
4ff0b52f74
commit
3e399f03a4
@ -53,11 +53,11 @@ public class AuthenticationWebFilter implements WebFilter {
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
|
||||
return authenticationConverter.apply(exchange)
|
||||
return this.authenticationConverter.apply(exchange)
|
||||
.switchIfEmpty(Mono.defer(() -> chain.filter(exchange).cast(Authentication.class)))
|
||||
.flatMap( token -> authenticationManager.authenticate(token)
|
||||
.flatMap(authentication -> authenticationSuccessHandler.success(authentication, exchange, chain))
|
||||
.onErrorResume( AuthenticationException.class, t -> entryPoint.commence(exchange, t))
|
||||
.flatMap( token -> this.authenticationManager.authenticate(token)
|
||||
.flatMap(authentication -> this.authenticationSuccessHandler.success(authentication, exchange, chain))
|
||||
.onErrorResume( AuthenticationException.class, t -> this.entryPoint.commence(exchange, t))
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user