How to redirect to main page after login.

This is my UI, a navbar with a login/logout button and side drawer (on the left). A DEFAULT, ADMIN, and USER user will have different services (showed by icons).

My problem is:

  1. After click login button → login view, how to set it back to this page once again?
  2. Should I put @AnonymousAllowed in MainView because it should be accessed by a default user (w/o auth)?

thanks in advance.

Answer question 1 is: ``` public class SecurityConfig extends VaadinWebSecurity {

protected void configure(HttpSecurity http) throws Exception {
    http.authorizeHttpRequests(auth ->
                    AntPathRequestMatcher.antMatcher(HttpMethod.GET, "/images/*.png")).permitAll()
    setLoginView(http, LoginView.class);
    // add default success url
    http.formLogin(auth -> auth.defaultSuccessUrl("/"));

when / points to MainView

Answer Q2: Yes it is :slightly_smiling_face: … many thanks for this community.