diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-07-21 09:58:17 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-07-21 13:27:47 +0000 |
commit | 2220b3f7db4921b6dba6243f679c5dbd7a404a64 (patch) | |
tree | 47f0ccf2a8c80aa2bd800b1fb05d3bc259c0a863 /core/Middleware | |
parent | a2423e8af94d7e38d22a5f06a8dfec93681f663b (diff) | |
download | nextcloud-server-2220b3f7db4921b6dba6243f679c5dbd7a404a64.tar.gz nextcloud-server-2220b3f7db4921b6dba6243f679c5dbd7a404a64.zip |
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 fb856ce8938..288a5305359 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -101,7 +101,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') { |