Routing to different view page after login

Hi Guys,

I have created an index view (IndexView.java) which is the root view. Now I have a login page that it would redirect to dashboard view (DashboardView.java) after logging in. The problem is that whenever I log in, it redirects to my index view. I have added the http.formLogin configuration in my security config. Please see my codes below.

@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeHttpRequests(authorizationManagerRequestMatcherRegistry -> { authorizationManagerRequestMatcherRegistry.requestMatchers(new AntPathRequestMatcher("/images/**"), new AntPathRequestMatcher("/index-layout.css")).permitAll(); }); http.formLogin(httpSecurityFormLoginConfigurer -> { httpSecurityFormLoginConfigurer.loginPage(LOGIN_URL) .successForwardUrl(SUCCESS_LOGIN_URL) .permitAll(); }); super.configure(http); this.setLoginView(http, LoginView.class); }

Hi Guys,

Can anyone help me on my inquiry? Thank you :slightly_smiling_face:

You can try to customize it after the call to super. Otherwise redirecting from the index page to other pages based on the user roles us also possible