Successful login routes to error page

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);

}
}

I do not fully understand your question. But can you please show your security configuation class?

I found my error. there were some unused and missing css in the style.css file. Once I removed them, the routing worked.

Thank you.

1 Like