diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-07-21 10:58:17 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2021-07-21 10:58:17 +0300 |
commit | 04fa36d4115da47f95f5d61ebf20bf448fa8109d (patch) | |
tree | 62aab033b033e78b9748ab34f2237f8bbee4342c /core/Middleware | |
parent | c8778d83fb18ef89fc2c003a35e0df943193e845 (diff) |
Improve provider check
Check if there is a provider missing.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'core/Middleware')
-rw-r--r-- | core/Middleware/TwoFactorMiddleware.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php index 0ba8be135f9..330a9258d90 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -100,7 +100,11 @@ class TwoFactorMiddleware extends Middleware { if ($controller instanceof ALoginSetupController && $this->userSession->getUser() !== null && $this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) { - return; + $providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser()); + + if ($providers->getProviders() === [] && !$providers->isProviderMissing()) { + return; + } } if ($controller instanceof LoginController && $methodName === 'logout') { |