serverLogoutSuccessHandler->logoutSuccessHandler

Issue: gh-4822
This commit is contained in:
Rob Winch 2017-11-14 15:32:25 -06:00
parent bf570854b8
commit 11f6e0477c
2 changed files with 9 additions and 8 deletions

View File

@ -753,7 +753,7 @@ public class ServerHttpSecurity {
}
public LogoutSpec logoutSuccessHandler(ServerLogoutSuccessHandler handler) {
this.logoutWebFilter.setServerLogoutSuccessHandler(handler);
this.logoutWebFilter.setLogoutSuccessHandler(handler);
return this;
}

View File

@ -44,7 +44,7 @@ public class LogoutWebFilter implements WebFilter {
private ServerLogoutHandler logoutHandler = new SecurityContextServerLogoutHandler();
private ServerLogoutSuccessHandler serverLogoutSuccessHandler = new RedirectServerLogoutSuccessHandler();
private ServerLogoutSuccessHandler logoutSuccessHandler = new RedirectServerLogoutSuccessHandler();
private ServerWebExchangeMatcher requiresLogout = ServerWebExchangeMatchers
.pathMatchers(HttpMethod.POST, "/logout");
@ -70,18 +70,19 @@ public class LogoutWebFilter implements WebFilter {
private Mono<Void> logout(WebFilterExchange webFilterExchange, Authentication authentication) {
return this.logoutHandler.logout(webFilterExchange, authentication)
.then(this.serverLogoutSuccessHandler.onLogoutSuccess(webFilterExchange, authentication))
.then(this.logoutSuccessHandler
.onLogoutSuccess(webFilterExchange, authentication))
.subscriberContext(ReactiveSecurityContextHolder.clearContext());
}
/**
* Sets the {@link ServerLogoutSuccessHandler}. The default is {@link RedirectServerLogoutSuccessHandler}.
* @param serverLogoutSuccessHandler the handler to use
* @param logoutSuccessHandler the handler to use
*/
public void setServerLogoutSuccessHandler(
ServerLogoutSuccessHandler serverLogoutSuccessHandler) {
Assert.notNull(serverLogoutSuccessHandler, "serverLogoutSuccessHandler cannot be null");
this.serverLogoutSuccessHandler = serverLogoutSuccessHandler;
public void setLogoutSuccessHandler(
ServerLogoutSuccessHandler logoutSuccessHandler) {
Assert.notNull(logoutSuccessHandler, "logoutSuccessHandler cannot be null");
this.logoutSuccessHandler = logoutSuccessHandler;
}
public void setLogoutHandler(ServerLogoutHandler logoutHandler) {