diff --git a/module-code/app/securesocial/core/SecureSocial.scala b/module-code/app/securesocial/core/SecureSocial.scala index 5d67d577e..05a5084a4 100644 --- a/module-code/app/securesocial/core/SecureSocial.scala +++ b/module-code/app/securesocial/core/SecureSocial.scala @@ -36,16 +36,16 @@ trait SecureSocial[U] extends Controller { implicit val env: RuntimeEnvironment[U] implicit def executionContext: ExecutionContext = env.executionContext + protected val notAuthenticatedJson = Unauthorized(Json.toJson(Map("error" -> "Credentials required"))).as(JSON) + protected val notAuthorizedJson = Forbidden(Json.toJson(Map("error" -> "Not authorized"))).as(JSON) + protected def notAuthorizedPage()(implicit request: RequestHeader): Html = securesocial.views.html.notAuthorized() + /** * A Forbidden response for ajax clients * @param request the current request * @tparam A * @return */ - protected val notAuthenticatedJson = Unauthorized(Json.toJson(Map("error" -> "Credentials required"))).as(JSON) - protected val notAuthorizedJson = Forbidden(Json.toJson(Map("error" -> "Not authorized"))).as(JSON) - protected def notAuthorizedPage()(implicit request: RequestHeader): Html = securesocial.views.html.notAuthorized() - protected def notAuthenticatedResult[A](implicit request: Request[A]): Future[Result] = { Future.successful { render {