It looks like Loc is being too eager about caching its params.
The following code should cause all requests to redirect to the login screen until the user logs in. Instead it redirects only the first page accessed. Any other URL does not redirect. That first page is stuck redirecting, even after the user has logged in. And it only prints "Redirecting to login" on the very first login.
def isLoggedIn = User.loggedIn_?
case Full(Req(path, _, _)) if !isLoggedIn && path != List("user_mgt", "login") =>
logger.debug("Redirecting to login")
Loc.EarlyResponse(() => Full(RedirectResponse("/user_mgt/login")))
If I use setSiteMapFunc instead of setSiteMap, and set my run.mode to debug, then I get the behavior I expect.
Please see [[url:http://groups.google.com/group/liftweb/browse_thread/thread/095e1615a1e04fb9/9fc458ed2e85a31a|this thread]] on the mailing list.
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/993
Closes #953 -- adds headers to Mailer. Closes #993 sitemap global par…
…ams no longer cached. Closes #989 -- formGroup for onSubmit same as submit and button. Closes #962 -- allows for separate subclasses of ProtoUser. Closes #979 -- allows for global LocParams in ProtoUser