override protected def refine[A]()

in membership-attribute-service/app/actions/AuthAndBackendViaAuthLibAction.scala [20:32]


  override protected def refine[A](request: Request[A]): Future[Either[Result, AuthenticatedUserAndBackendRequest[A]]] = {
    touchpointBackends.normal.identityAuthService.user(requiredScopes)(request) map {
      case Left(AuthenticationFailure.Unauthorised) => Left(Results.Unauthorized)
      case Left(AuthenticationFailure.Forbidden) => Left(Results.Forbidden)
      case Right(authenticatedUser) =>
        val backendConf = if (testUserChecker.isTestUser(authenticatedUser.primaryEmailAddress)(authenticatedUser.logPrefix)) {
          touchpointBackends.test
        } else {
          touchpointBackends.normal
        }
        Right(new AuthenticatedUserAndBackendRequest[A](authenticatedUser, backendConf, request))
    }
  }