Skip to content

Commit

Permalink
Skip two factor challenge in account module middleware
Browse files Browse the repository at this point in the history
Fixes issue with infinite redirect when trying to access the challenge
page.
  • Loading branch information
Vincent Petry committed Jul 16, 2018
1 parent 84c8349 commit 16385bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/Middleware/AccountModuleMiddleware.php
Expand Up @@ -32,6 +32,7 @@
use OCP\Authentication\IAccountModuleController;
use OCP\ILogger;
use OCP\IUserSession;
use OC\Core\Controller\TwoFactorChallengeController;

/**
* Class AccountModuleMiddleware
Expand Down Expand Up @@ -94,6 +95,11 @@ public function beforeController($controller, $methodName) {
return;
}

if ($controller instanceof TwoFactorChallengeController) {
// Don't block two factor challenge
return;
}

if ($this->session->isLoggedIn()) {
$user = $this->session->getUser();
if ($user === null) {
Expand Down

0 comments on commit 16385bb

Please sign in to comment.