Skip to content

Commit

Permalink
support only play2.2 on 0.7.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshizawa committed Aug 12, 2014
1 parent 001a914 commit f5ea4c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ trait OAuth2Provider extends OAuth2BaseProvider {
* @return Request is successful then return JSON to client in OAuth 2.0 format.
* Request is failed then return BadRequest or Unauthorized status to client with cause into the JSON.
*/
def issueAccessToken[A, U](dataHandler: DataHandler[U])(implicit request: play.api.mvc.Request[A]): Result = {
def issueAccessToken[A, U](dataHandler: DataHandler[U])(implicit request: play.api.mvc.Request[A]): SimpleResult = {
TokenEndpoint.handleRequest(request, dataHandler) match {
case Left(e) if e.statusCode == 400 => BadRequest(responseOAuthErrorJson(e)).withHeaders(responseOAuthErrorHeader(e))
case Left(e) if e.statusCode == 401 => Unauthorized(responseOAuthErrorJson(e)).withHeaders(responseOAuthErrorHeader(e))
Expand All @@ -128,7 +128,7 @@ trait OAuth2Provider extends OAuth2BaseProvider {
* @return Authentication is successful then the response use your API result.
* Authentication is failed then return BadRequest or Unauthorized status to client with cause into the JSON.
*/
def authorize[A, U](dataHandler: DataHandler[U])(callback: AuthInfo[U] => Result)(implicit request: play.api.mvc.Request[A]): Result = {
def authorize[A, U](dataHandler: DataHandler[U])(callback: AuthInfo[U] => SimpleResult)(implicit request: play.api.mvc.Request[A]): SimpleResult = {
ProtectedResource.handleRequest(request, dataHandler) match {
case Left(e) if e.statusCode == 400 => BadRequest.withHeaders(responseOAuthErrorHeader(e))
case Left(e) if e.statusCode == 401 => Unauthorized.withHeaders(responseOAuthErrorHeader(e))
Expand Down
6 changes: 3 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import Keys._
object ScalaOAuth2Build extends Build {

lazy val _organization = "com.nulab-inc"
lazy val _version = "0.8.0"
lazy val _playVersion = "2.3.2"
lazy val _version = "0.7.3"
lazy val _playVersion = "2.2.4"

val _scalaVersion = "2.10.4"
val _crossScalaVersions = Seq("2.10.4", "2.11.1")
val _crossScalaVersions = Seq("2.10.4")

val commonDependenciesInTestScope = Seq(
"org.scalatest" %% "scalatest" % "2.2.0" % "test"
Expand Down

0 comments on commit f5ea4c7

Please sign in to comment.