Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- @EnableWebSecurity
- public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests()
- .antMatchers("/bower_components/**", "/*.js",
- "/*.jsx", "/main.css").permitAll()
- .antMatchers("/login").permitAll()
- .antMatchers("/handle/**").permitAll()
- .antMatchers("/build/*").permitAll()
- .antMatchers("/register").permitAll()
- .antMatchers("/css/**").permitAll()
- .antMatchers("/js/**").permitAll()
- .anyRequest().authenticated()
- .and()
- .formLogin()
- .loginPage("/loginn")
- .defaultSuccessUrl("/", true)
- .permitAll()
- .and()
- .logout()
- .logoutSuccessUrl("/")
- .and()
- .csrf()
- .disable();
- }
Add Comment
Please, Sign In to add comment