Bladeren bron

Logout at the end of logout method

Issue: gh-4719
Rob Winch 7 jaren geleden
bovenliggende
commit
4777a869bc

+ 3 - 1
web/src/main/java/org/springframework/security/web/server/authentication/logout/LogoutWebFilter.java

@@ -16,6 +16,7 @@
 
 package org.springframework.security.web.server.authentication.logout;
 
+import org.springframework.security.core.context.ReactiveSecurityContextHolder;
 import org.springframework.util.Assert;
 import reactor.core.publisher.Mono;
 
@@ -68,7 +69,8 @@ public class LogoutWebFilter implements WebFilter {
 
 	private Mono<Void> logout(WebFilterExchange webFilterExchange, Authentication authentication) {
 		return this.serverLogoutHandler.logout(webFilterExchange, authentication)
-			.then(this.serverLogoutSuccessHandler.onLogoutSuccess(webFilterExchange, authentication));
+			.then(this.serverLogoutSuccessHandler.onLogoutSuccess(webFilterExchange, authentication))
+			.subscriberContext(ReactiveSecurityContextHolder.clearContext());
 	}
 
 	/**