From 0629b58382eaafda42524b1465463c4e8905c465 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 30 Jul 2021 18:29:23 +0200 Subject: [PATCH] Fix setting up 2FA providers when 2FA is enforced and bc are generated When a user has backup codes generated and got their 2FA enforced then they should be able to set up TOTP and similar providers during the login. Signed-off-by: Christoph Wurst --- core/Middleware/TwoFactorMiddleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php index 330a9258d9047..398234fa1e410 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -92,7 +92,7 @@ public function beforeController($controller, $methodName) { && !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) { $providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser()); - if (!($providers->getProviders() === [] && !$providers->isProviderMissing())) { + if (!($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing())) { throw new TwoFactorAuthRequiredException(); } }