I have an action which allows user to change his password. When everything goes well, I’d like to logout him and display a message that everything went well and now he needs to login using his new password.
I tried:
flash.message = "You may now login with your new password"
redirect (controller: 'logout')
Thing is that Logout controller makes redirection to:
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl
And my flash message is no longer there when user is definitely logged out and back on main page. Any ideas how to make it work or maybe some workarounds?
LogoutController is just there as a convenience. There’s a filter that intercepts its redirect and performs the logout logic, so you can just redirect directly to that: