Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-17 16:48:41 +0300
committerChristoph Wurst <christoph@owncloud.com>2016-05-23 12:21:13 +0300
commit847bbc51b61b4222503ae089f78124c2d18d5f22 (patch)
tree9aceb14765309d83ed6d20fb2848caa8fb543661 /core/Middleware
parentdfb4d426c24c8cbb7e207a3dd92b5fcd894a1977 (diff)
add OCC command to enable/disable 2FA for a user
Diffstat (limited to 'core/Middleware')
-rw-r--r--core/Middleware/TwoFactorMiddleware.php4
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