Reputation: 3379
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?
Upvotes: 6
Views: 2692
Reputation: 486
Here is a work-around for this problem:
delay
and fadeutAndRemove
on the
flash message div which then redirects to the logout controller It's not perfect but it gets the message to the user and takes them back to the login page
Upvotes: 0
Reputation: 75671
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:
flash.message = "You may now login with your new password"
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl
Upvotes: 3