This commit is contained in:
Filip Izydorczyk 2020-10-24 17:54:00 +02:00
parent a1f17d271f
commit 4614a11a8b

View File

@ -42,9 +42,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().formLogin().disable().httpBasic().disable().logout().disable().sessionManagement() http.csrf().disable().cors().and().formLogin().disable().httpBasic().disable().logout().disable()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling().and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling()
.authenticationProvider(provider) .and().authenticationProvider(provider)
.addFilterBefore(authenticationFilter(), AnonymousAuthenticationFilter.class).authorizeRequests() .addFilterBefore(authenticationFilter(), AnonymousAuthenticationFilter.class).authorizeRequests()
.anyRequest().authenticated(); .anyRequest().authenticated();