Obridado Alberto,
resolveu meu problema. Segue uma resposta mais detalhada para ajudar outras pessoas.
1. Primeiramente Cria uma classe e implemente a interface AuthenticationSuccessHandler:
public class RedirectAfterLogin implements AuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
response.sendRedirect("/home");
}
}
2. Depois é só adicionar no metodo configure do spring security, exemplo:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll().successHandler(new RedirectAfterLogin())
.and().logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
}
Apenas isso!!