Commit 1d12658a authored by Jason Song's avatar Jason Song Committed by GitHub

fix the issue that an immediate login after logout will be redirected to signin page (#2633)

parent 40c5e478
......@@ -273,11 +273,10 @@ public class AuthConfiguration {
http.authorizeRequests()
.antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**").permitAll()
.antMatchers("/**").hasAnyRole(USER_ROLE);
http.formLogin().loginPage("/signin").permitAll().failureUrl("/signin?#/error").and().httpBasic();
SimpleUrlLogoutSuccessHandler urlLogoutHandler = new SimpleUrlLogoutSuccessHandler();
urlLogoutHandler.setDefaultTargetUrl("/signin?#/logout");
http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and()
.httpBasic();
http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true)
.logoutSuccessHandler(urlLogoutHandler);
.logoutSuccessUrl("/signin?#/logout");
http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment