mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-23 05:00:23 +08:00
🎨 Improving structure / format of the code.
This commit is contained in:
parent
9c3bc31343
commit
483f7a3364
@ -30,7 +30,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
|
||||
* @date 2019/2/1
|
||||
*/
|
||||
@EnableWebSecurity
|
||||
public class WebSecurityConfigurer{
|
||||
public class WebSecurityConfigurer {
|
||||
|
||||
private final String adminContextPath;
|
||||
|
||||
@ -49,23 +49,12 @@ public class WebSecurityConfigurer{
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
successHandler.setTargetUrlParameter("redirectTo");
|
||||
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
||||
http
|
||||
.headers().frameOptions().disable()
|
||||
.and().authorizeRequests()
|
||||
.antMatchers(adminContextPath + "/assets/**"
|
||||
, adminContextPath + "/login"
|
||||
, adminContextPath + "/instances/**"
|
||||
, adminContextPath + "/actuator/**"
|
||||
).permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin().loginPage(adminContextPath + "/login")
|
||||
.successHandler(successHandler).and()
|
||||
.logout().logoutUrl(adminContextPath + "/logout")
|
||||
.and()
|
||||
.httpBasic().and()
|
||||
.csrf()
|
||||
.disable();
|
||||
http.headers().frameOptions().disable().and().authorizeRequests()
|
||||
.antMatchers(adminContextPath + "/assets/**", adminContextPath + "/login",
|
||||
adminContextPath + "/instances/**", adminContextPath + "/actuator/**")
|
||||
.permitAll().anyRequest().authenticated().and().formLogin().loginPage(adminContextPath + "/login")
|
||||
.successHandler(successHandler).and().logout().logoutUrl(adminContextPath + "/logout").and().httpBasic()
|
||||
.and().csrf().disable();
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user