I’m implementing an email mechanism in Play:
- User gets an email with a validation link
- Clicks on it, gets to a controller that saves the “validated” bit on the user model, then redirects him to another page.
- Before redirecting, that last page puts a message into the
flashobject … to be displayed later in whatever page the user ends up at, via javascript. The message says “thanks for validating your email”. - The target page has @With(Secure.class), so if the user is not authenticated I reach the Secure.login() method.
Now, at this point, I find that flash does not contain the message I just put in there before the redirection. What is the correct way to use flash in a way that survives this redirect?
This seems to work: