Hi all-
I feel like I'm monopolizing the stack for Scala/Lift, so I apologize, but the questions keep coming. Here's the latest.
I'm trying to restrict access to anything in the /login/* to those users who have not yet logged in.
Here is how I'm trying to do it:
val entries = Menu(Loc("Home", List("index"), "Home")) :: //login stuff
Menu(Loc("loginBase", ("login"::""::Nil)->true, "Login Base", Hidden, anyLoggedIn))::...
Thats the entry in SiteMap. Then I define anyLoggedIn in Boot.scala like so:
val anyLoggedIn = If(() => !(Student.loggedIn_? || Provider.loggedIn_?),
if (sessionLoginType.is map {_ == StudentLogin} openOr false)
{
println("student")
RedirectResponse("studentHome")
}
else
{
println("provider")
RedirectResponse("providerHome")
}
I want to send providers and students to their "homes" respectively, when they try to access any login page when they are already logged in. For some reason, (maybe its my boolean logic), it never works, and I never make it to the redirects.
Any Ideas?
Thanks