Skip to content

Commit

Permalink
Merge pull request #28085 from nextcloud/backport/28078/stable22
Browse files Browse the repository at this point in the history
[stable22] Improve provider check
  • Loading branch information
LukasReschke authored Jul 21, 2021
2 parents 79c10ff + 9877075 commit 9305eaa
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 @@ -100,7 +100,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 9305eaa

Please sign in to comment.