I'm using spring security for logout page. when user access and view product detail page, user continues to click logout, and then it will redirect to home page, it work fine !
this is my code:
@RequestMapping(value="/logout", method = RequestMethod.GET)
public String logoutPage (HttpServletRequest request, HttpServletResponse response) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth != null){
new SecurityContextLogoutHandler().logout(request, response, auth);
}
return "redirect:/homepage";
}
However I want when user logout, user still access current page(product detail page) and no need it redirect to homepage
How to fix the problem ? Thank so much !