I have a sitemap defined like this in Boot.scala
def sitemap() = SiteMap(
Menu(S ? "Home") / "index",
Menu(S ? "Login") / "login",
Menu(S ? "Do Logged in Stuff") / "loggedinstuff" >> If( () => loggedInUser.is != Empty, "You must be logged in") )
Also I have a loggedInUser defined in Boot.scala like this
object loggedInUser extends SessionVar[Box[String]](Empty)
When I have a user log in, I want them to change my loggedInUser to be the username that they successfully logged in as.
I was able to get it to work by doing like here
Scala and Lift and SessionVar that loses it contents
Made this object
object SessionState {
object loggedInUserName extends SessionVar[Box[String]](Empty)
}
and then did
SessionState.loggedInUserName(Full(username))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With