aboutsummaryrefslogtreecommitdiffstats
path: root/core/Middleware
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2021-07-21 09:58:17 +0200
committerLukas Reschke <lukas@statuscode.ch>2021-07-21 09:58:17 +0200
commit04fa36d4115da47f95f5d61ebf20bf448fa8109d (patch)
tree62aab033b033e78b9748ab34f2237f8bbee4342c /core/Middleware
parentc8778d83fb18ef89fc2c003a35e0df943193e845 (diff)
downloadnextcloud-server-04fa36d4115da47f95f5d61ebf20bf448fa8109d.tar.gz
nextcloud-server-04fa36d4115da47f95f5d61ebf20bf448fa8109d.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.php6
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') {