This is my current security config class, very simple:
package com.agilsistemas.portalparceiros.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.agilsistemas.portalparceiros.views.Login;
import com.vaadin.flow.spring.security.VaadinWebSecurity;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends VaadinWebSecurity {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(requests -> requests.antMatchers("/public/**", "/login", "/images/**"));
http.userDetailsService(userDetailsServiceBean());
super.configure(http);
setLoginView(http, Login.class);
}
@Bean
public UserDetailsService userDetailsServiceBean() throws Exception {
return new UserDetailService();
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}```
I was using the old format of `http.authorizeRequests().antMatchers("...").permitAll();`, that worked, but after updating to Spring ``2.7.12`, it gives me warnings that I should change to the above lambda style. But now Vaadin refuses to start with the following error:
```java.lang.IllegalStateException: permitAll only works with either HttpSecurity.authorizeRequests() or HttpSecurity.authorizeHttpRequests(). Please define one or the other but not both.```
How can I fix this? Is my current version of Vaadin using permitAll()?