private def requireTwoFactorAuthFor()

in play-v30/src/main/scala/com/gu/googleauth/actions.scala [144:151]


  private def requireTwoFactorAuthFor(userIdentity: UserIdentity)(checker: TwoFactorAuthChecker)(
    implicit ec: ExecutionContext
  ): EitherT[Future, Result, UserIdentity] = EitherT {
    checker.check(userIdentity.email).map(userHas2FA => if (userHas2FA) Right(userIdentity) else {
      logger.warn(s"failed-oauth-callback : user-does-not-have-2fa")
      Left(redirectWithError(failureRedirectTarget, "You do not have 2FA enabled"))
    })
  }