After login, it goes to the page. If I type in the url for a permitAll page, it displays correctly. I reverted back to the basic project from Start.vaadin.com.
http://localhost:8080/@fontsource/noto-serif-tc/index.css?continue
My home page is AnonymousAllowed and a Videos page which is permitAll. From the home page, I click on the video button, it will redirect to the login page. After log in, it redirects me to the url above.
BTW, I’m using Vaadin 24
SecurityConfiguration.java
EnableWebSecurity
Configuration
public class SecurityConfiguration extends VaadinWebSecurity {
Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize -> authorize
.requestMatchers(AntPathRequestMatcher.antMatcher(HttpMethod.GET, "/icons/**")).permitAll()
.requestMatchers(AntPathRequestMatcher.antMatcher(HttpMethod.GET, "/images/**")).permitAll()
.requestMatchers(AntPathRequestMatcher.antMatcher(HttpMethod.GET, "/line-awesome/**")).permitAll()
);
super.configure(http);
setLoginView(http, LoginView.class);
}
}