Permalink
Browse files

Updated to Lift v 2.5-SNAPSHOT, fixed ext session bug

  • Loading branch information...
eltimn committed Jun 1, 2012
1 parent 83cc3a5 commit b51a57f419069ad972158006f850feeb952aaa00
Showing with 2 additions and 8 deletions.
  1. +2 −2 build.sbt
  2. +0 −6 src/main/scala/net.liftmodules/mongoauth/model/ExtSession.scala
View
@@ -1,6 +1,6 @@
name := "mongoauth"
-version := "2.4-0.3"
+version := "2.5-SNAPSHOT-0.4"
organization := "net.liftmodules"
@@ -14,7 +14,7 @@ libraryDependencies <++= (scalaVersion) { scalaVersion =>
case "2.8.1" | "2.8.2" => "1.5.1"
case _ => "1.6.1"
}
- val liftVersion = "2.4"
+ val liftVersion = "2.5-SNAPSHOT"
Seq(
"net.liftweb" %% "lift-mongodb-record" % liftVersion % "compile",
"ch.qos.logback" % "logback-classic" % "0.9.26" % "provided",
@@ -39,7 +39,6 @@ object ExtSession extends ExtSession with MongoMetaRecord[ExtSession] with Logga
// create an extSession
def createExtSession(uid: ObjectId) {
deleteExtCookie() // make sure existing cookie is removed
- deleteAllByUserId(uid) // make sure all existing db entries are deleted
val inst = createRecord
.userId(uid)
.save
@@ -70,10 +69,6 @@ object ExtSession extends ExtSession with MongoMetaRecord[ExtSession] with Logga
}
}
- def deleteAllByUserId(uid: ObjectId) {
- delete(userId.name, uid)
- }
-
def handleExtSession: Box[ExtSession] = {
val extSess = for {
cookie <- S.findCookie(cookieName) // empty means we should ignore it
@@ -85,7 +80,6 @@ object ExtSession extends ExtSession with MongoMetaRecord[ExtSession] with Logga
extSess match {
case Failure(msg, _, _) => deleteExtCookie(); extSess // cookie is not valid, delete it
case Full(es) if (es.expires.isExpired) => // if it's expired, delete it and the cookie
- extSess.foreach(_.delete_!)
deleteExtCookie()
Failure("Extended session has expired")
case _ => extSess

0 comments on commit b51a57f

Please sign in to comment.