Question

I have a Play! web application. If the user is logged in, I would like to show a "Logout" link in the top menu. If the user is not logged in, I'd like to hide the "Logout" link and show a "Login" link instead. Easy, right? However, I am unable to find information on how to actually do this.

So, how would I go about this? I used the yabe web app as an example. Is there a #{secure.check} equivalent to check if the user has already logged in? What's the easiest way?

Help would be greatly appreciated, this is driving me nuts!

Was it helpful?

Solution

Quite simple :

#{if session.connected()}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top