Skip to content

Commit

Permalink
Update to Scala 2.9.2 and upgrade other dependent libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
sroebuck committed Apr 24, 2012
1 parent 48e4c5e commit 71adf1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
16 changes: 11 additions & 5 deletions build.sbt
Expand Up @@ -4,13 +4,19 @@ name := "scalatra-userauth"

version := "0.1.3-SNAPSHOT"

// set the Scala version used for the project
scalaVersion := "2.9.2"

scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xcheckinit", "-Xmigration", "-encoding", "UTF-8")

libraryDependencies ++= Seq(
"javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
"com.weiglewilczek.slf4s" %% "slf4s" % "1.0.7",
"org.scalatra" %% "scalatra" % "2.0.3"
)
libraryDependencies ++= {
val sv = "2.9.1"
Seq(
"javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
"com.weiglewilczek.slf4s" % ("slf4s" + "_" + sv) % "1.0.7",
"org.scalatra" % ("scalatra" + "_" + sv) % "2.0.4"
)
}


// ls-sbt configuration
Expand Down
Expand Up @@ -23,7 +23,7 @@ import java.security.SecureRandom
class RememberMeStrategy[U] extends UserAuthStrategy[U] with Logging {


logger.info("Scalatra-UserAuth RememberMe Strategy Initialised")
logger.debug("Scalatra-UserAuth RememberMe Strategy Initialised")

/**
* The cookie token name used to store the users remember me token as a cookie.
Expand Down Expand Up @@ -102,7 +102,7 @@ class RememberMeStrategy[U] extends UserAuthStrategy[U] with Logging {
val token = generateToken("x")
val cookie = Cookie(COOKIE_KEY, token)(CookieOptions(secure = cookieIsSecure, maxAge = cookieLifeInSeconds, httpOnly = true))
val cookieString = cookie.toCookieString
logger.info("cookieString = " + cookieString)
logger.debug("cookieString = " + cookieString)
app.response.addHeader("Set-Cookie", cookieString)
app match {
case r: RememberMeSupport[U] with UserAuthSupport[U] =>
Expand Down
Expand Up @@ -50,6 +50,7 @@ trait UserAuthSupport[U] extends ScalatraKernel with Initializable with Logging
def userOption: Option[U] = if (request != null && session != null) userOptionFromSession(session) else None



def userLogin(username: String, password: String): Either[String, U]

/**
Expand Down

0 comments on commit 71adf1b

Please sign in to comment.