Polish AuthenticationWebFilter

Code style
This commit is contained in:
Rob Winch 2017-09-11 18:49:29 -05:00
parent 4ff0b52f74
commit 3e399f03a4

View File

@ -53,11 +53,11 @@ public class AuthenticationWebFilter implements WebFilter {
@Override @Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { 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))) .switchIfEmpty(Mono.defer(() -> chain.filter(exchange).cast(Authentication.class)))
.flatMap( token -> authenticationManager.authenticate(token) .flatMap( token -> this.authenticationManager.authenticate(token)
.flatMap(authentication -> authenticationSuccessHandler.success(authentication, exchange, chain)) .flatMap(authentication -> this.authenticationSuccessHandler.success(authentication, exchange, chain))
.onErrorResume( AuthenticationException.class, t -> entryPoint.commence(exchange, t)) .onErrorResume( AuthenticationException.class, t -> this.entryPoint.commence(exchange, t))
); );
} }