diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-05-17 15:48:41 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-05-23 11:21:13 +0200 |
commit | 847bbc51b61b4222503ae089f78124c2d18d5f22 (patch) | |
tree | 9aceb14765309d83ed6d20fb2848caa8fb543661 /core/Middleware | |
parent | dfb4d426c24c8cbb7e207a3dd92b5fcd894a1977 (diff) | |
download | nextcloud-server-847bbc51b61b4222503ae089f78124c2d18d5f22.tar.gz nextcloud-server-847bbc51b61b4222503ae089f78124c2d18d5f22.zip |
add OCC command to enable/disable 2FA for a user
Diffstat (limited to 'core/Middleware')
-rw-r--r-- | core/Middleware/TwoFactorMiddleware.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php index ea25aa36ecd..bcb06d20081 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -82,6 +82,10 @@ class TwoFactorMiddleware extends Middleware { if ($this->twoFactorManager->isTwoFactorAuthenticated($user)) { $this->checkTwoFactor($controller, $methodName); + } else if ($controller instanceof TwoFactorChallengeController) { + // Allow access to the two-factor controllers only if two-factor authentication + // is in progress. + throw new UserAlreadyLoggedInException(); } } // TODO: dont check/enforce 2FA if a auth token is used |