diff --git a/elastic4play/app/org/elastic4play/controllers/Authenticated.scala b/elastic4play/app/org/elastic4play/controllers/Authenticated.scala index 00b3eac58..6b802c327 100644 --- a/elastic4play/app/org/elastic4play/controllers/Authenticated.scala +++ b/elastic4play/app/org/elastic4play/controllers/Authenticated.scala @@ -162,7 +162,7 @@ class Authenticated( .foldLeft[Future[Either[Seq[(String, Throwable)], AuthContext]]](Future.successful(Left(Nil))) { case (acc, (authMethodName, authMethod)) => acc.flatMap { - case authContext if authContext.isRight => Future.successful(authContext) + case authContext @ Right(_) => Future.successful(authContext) case Left(errors) => authMethod(request) .map(authContext => Right(authContext)) diff --git a/elastic4play/app/org/elastic4play/services/JsonFormat.scala b/elastic4play/app/org/elastic4play/services/JsonFormat.scala index f40b10924..1331c5e05 100644 --- a/elastic4play/app/org/elastic4play/services/JsonFormat.scala +++ b/elastic4play/app/org/elastic4play/services/JsonFormat.scala @@ -203,6 +203,7 @@ object JsonFormat { val categories = (json \ "_categories").as[Map[String, QueryDef]] val selectables = (json \ "_select").as[Seq[Agg]] JsSuccess(groupByCaterogy(aggregationName, categories, selectables: _*)) + case unexpected: JsValue => JsError(s"Unexpected JsValue $unexpected") } implicit val authContextWrites: OWrites[AuthContext] = OWrites[AuthContext] { authContext =>