I\'m using spring security with REST, and I\'m using the URL (/logout
) as an endpoint for my logout method. But after calling this method, it redirect me to (
So since there is no accepted answer yet, i post my solution, which worked for me:
.logout()
.logoutUrl("/api/user/logout")
.permitAll()
.logoutSuccessHandler((httpServletRequest, httpServletResponse, authentication) -> {
httpServletResponse.setStatus(HttpServletResponse.SC_OK);
})
.and()
Just return a clean HTTP_OK (200) after successful logout - spring won't redirect you in this case