@@ -59,15 +59,15 @@ Add dependency declarations into your `Build.scala` or `build.sbt` file:
5959
6060* __ for Play2.3.x__
6161
62- "jp.t2v" %% "play2-auth" % "0.13.0 ",
63- "jp.t2v" %% "play2-auth-test" % "0.13.0 " % "test"
62+ "jp.t2v" %% "play2-auth" % "0.13.1 ",
63+ "jp.t2v" %% "play2-auth-test" % "0.13.1 " % "test"
6464
6565For example your ` Build.scala ` might look like this:
6666
6767``` scala
6868 val appDependencies = Seq (
69- " jp.t2v" %% " play2-auth" % " 0.13.0 " ,
70- " jp.t2v" %% " play2-auth-test" % " 0.13.0 " % " test"
69+ " jp.t2v" %% " play2-auth" % " 0.13.1 " ,
70+ " jp.t2v" %% " play2-auth-test" % " 0.13.1 " % " test"
7171 )
7272```
7373
8080
8181 ``` scala
8282 // Example
83+ import jp .t2v .lab .play2 .auth ._
84+
8385 trait AuthConfigImpl extends AuthConfig {
8486
8587 /**
@@ -142,8 +144,16 @@ Usage
142144 /**
143145 * If authorization failed (usually incorrect password) redirect the user as follows:
144146 */
145- def authorizationFailed (request : RequestHeader )(implicit ctx : ExecutionContext ): Future [Result ] =
147+ override def authorizationFailed (request : RequestHeader , user : User , authority : Option [ Authority ] )(implicit context : ExecutionContext ): Future [Result ] = {
146148 Future .successful(Forbidden (" no permission" ))
149+ }
150+
151+ /**
152+ * This method is kept for compatibility.
153+ * It will be removed in a future version
154+ * Override `authorizationFailed(RequestHeader, User, Option[Authority])` instead of this
155+ */
156+ def authorizationFailed (request : RequestHeader )(implicit ctx : ExecutionContext ): Future [Result ] = throw new AsserionError
147157
148158 /**
149159 * A function that determines what `Authority` a user has.
@@ -158,16 +168,18 @@ Usage
158168 }
159169
160170 /**
161- * Whether use the secure option or not use it in the cookie.
162- * However default is false, I strongly recommend using true in a production.
163- */
164- override lazy val cookieSecureOption : Boolean = play.api.Play .isProd(play.api.Play .current)
165-
166- /**
167- * Whether a login session is closed when the brower is terminated.
168- * default is false.
171+ * (Optional)
172+ * You can custom SessionID Token handler.
173+ * Default implemntation use Cookie.
169174 */
170- override lazy val isTransientCookie : Boolean = false
175+ override lazy val tokenAccessor = new CookieTokenAccessor (
176+ /*
177+ * Whether use the secure option or not use it in the cookie.
178+ * However default is false, I strongly recommend using true in a production.
179+ */
180+ cookieSecureOption = play.api.Play .isProd(play.api.Play .current),
181+ cookieMaxAge = Some (sessionTimeoutInSeconds)
182+ )
171183
172184 }
173185 ```
0 commit comments