Update HttpSecurityConfig.java

This commit is contained in:
Rufina Uche 2023-10-07 12:44:06 +01:00 committed by GitHub
parent 5446928547
commit 1b1ba05a50
1 changed files with 5 additions and 5 deletions

View File

@ -14,16 +14,16 @@ public class HttpSecurityConfig extends WebSecurityConfigurerAdapter {
// Given: HttpSecurity configured
http
.authorizeRequests()
.authorizeRequests()
.antMatchers("/public/**").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.anyRequest().authenticated()
.and()
.formLogin()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.and()
.logout()
.permitAll();
// When: Accessing specific URLs