I have modal login forms. After the user successfully logs in, the user is redirected to the / page. I am trying to find a way to stay on the contact page or another page after logging in. How to do it? My code is:
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/css/**","/js/**","/fonts/**","/images/**","/home","/","/kontakt").permitAll() .antMatchers("/userlist").hasRole("ADMIN") .anyRequest().authenticated(); http .formLogin() .loginPage("/login") .permitAll() .and() .logout() .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) .logoutSuccessUrl("/"); }
spring spring-boot spring-security
set4812
source share