serverLogoutSuccessHandler->logoutSuccessHandler
Issue: gh-4822
This commit is contained in:
parent
bf570854b8
commit
11f6e0477c
|
@ -753,7 +753,7 @@ public class ServerHttpSecurity {
|
|||
}
|
||||
|
||||
public LogoutSpec logoutSuccessHandler(ServerLogoutSuccessHandler handler) {
|
||||
this.logoutWebFilter.setServerLogoutSuccessHandler(handler);
|
||||
this.logoutWebFilter.setLogoutSuccessHandler(handler);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue