Improve session handling.

This commit is contained in:
takezoe
2013-09-23 00:18:38 +09:00
parent fd8b5780f3
commit 296fc9a3df
6 changed files with 16 additions and 11 deletions

View File

@@ -63,11 +63,7 @@ abstract class ControllerBase extends ScalatraFilter
request.getRequestURI + (if(queryString != null) "?" + queryString else "")
}
private def LoginAccount: Option[Account] =
session.get("LOGIN_ACCOUNT") match {
case Some(x: Account) => Some(x)
case _ => None
}
private def LoginAccount: Option[Account] = session.getAs[Account]("LOGIN_ACCOUNT")
def ajaxGet(path : String)(action : => Any) : Route =
super.get(path){