From e4011bc3aa713c0c2901a152df9b67935b7989ef Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Dec 2021 11:35:36 +0100 Subject: [PATCH] Fix setting up 2FA when no providers are set up but backup codes 2FA set up is allowed when only backup codes are set up but no other provider and no provider is failing. This patch syncs up the login controller check with the challenge controller check 10 lines above. 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 4c13a99a1aabb..47b09536acd38 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -109,7 +109,7 @@ public function beforeController($controller, $methodName) { && $this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) { $providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser()); - if ($providers->getProviders() === [] && !$providers->isProviderMissing()) { + if ($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing()) { return; } }