Update WebSecurityConfig.java

This commit is contained in:
Rufina Uche 2023-10-07 12:49:07 +01:00 committed by GitHub
parent 1b1ba05a50
commit 8177e74307

View File

@ -17,12 +17,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception { protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder()); auth
.userDetailsService(userDetailsService)
.passwordEncoder(new BCryptPasswordEncoder());
} }
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests() http
.authorizeRequests()
.antMatchers("/").permitAll() .antMatchers("/").permitAll()
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()