Skip to content

Commit

Permalink
Merge pull request #28086 from nextcloud/backport/28078/stable21
Browse files Browse the repository at this point in the history
[stable21] Improve provider check
  • Loading branch information
LukasReschke authored Jul 21, 2021
2 parents a2423e8 + 2220b3f commit 3d1fb04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/Middleware/TwoFactorMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ public function beforeController($controller, $methodName) {
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') {
Expand Down

0 comments on commit 3d1fb04

Please sign in to comment.