From 74b1bf1d1cdce55bf7a33acc66b132250c9755fa Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Dec 2021 11:35:36 +0100 Subject: 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(-) (limited to 'core/Middleware') diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php index 4c13a99a1aa..47b09536acd 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -109,7 +109,7 @@ class TwoFactorMiddleware extends Middleware { && $this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) { $providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser()); - if ($providers->getProviders() === [] && !$providers->isProviderMissing()) { + if ($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing()) { return; } } -- cgit v1.2.3