package app.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(final HttpSecurity http) throws Exception {
        http.headers().defaultsDisabled().cacheControl();

        http.logout()
                .logoutSuccessUrl("/")
                .invalidateHttpSession(true)
                .logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
    }
}


@@ -349,16 +349,258 @@
 dapter;%0A
+import org.springframework.security.web.DefaultRedirectStrategy;%0Aimport org.springframework.security.web.authentication.logout.LogoutSuccessHandler;%0Aimport org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler;%0A
 import o
@@ -667,16 +667,16 @@
 atcher;%0A
-
 %0A@Config
@@ -1025,16 +1025,71 @@
 n(true)%0A
+                .logoutSuccessHandler(logoutHandler())%0A
         
@@ -1162,12 +1162,421 @@
 );%0A    %7D
+%0A%0A    private LogoutSuccessHandler logoutHandler() %7B%0A        final SimpleUrlLogoutSuccessHandler logoutSuccessHandler = new SimpleUrlLogoutSuccessHandler();%0A        final DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();%0A%0A        redirectStrategy.setContextRelative(false);%0A        logoutSuccessHandler.setRedirectStrategy(redirectStrategy);%0A%0A        return logoutSuccessHandler;%0A    %7D
 %0A%7D%0A%0A

Add a LogoutSuccessHandler to show usage of a RedirectStrategy that's not context-relative