diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-06-01 11:19:49 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-06-01 11:19:49 +0200 |
commit | 3ec6f4e1652444d58f0c1dd712fac02e926d39a6 (patch) | |
tree | 81c3669c92093a56f4c3b62570a2995e1fa5215e /lib/private/legacy/api.php | |
parent | 7b4459d28d40523c70ec05a733e158f2c14faac4 (diff) | |
download | nextcloud-server-3ec6f4e1652444d58f0c1dd712fac02e926d39a6.tar.gz nextcloud-server-3ec6f4e1652444d58f0c1dd712fac02e926d39a6.zip |
block OCS if 2FA challenge needs to be solved first
Diffstat (limited to 'lib/private/legacy/api.php')
-rw-r--r-- | lib/private/legacy/api.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/legacy/api.php b/lib/private/legacy/api.php index a4745f58d02..1e581153ce6 100644 --- a/lib/private/legacy/api.php +++ b/lib/private/legacy/api.php @@ -341,6 +341,10 @@ class OC_API { // reuse existing login $loggedIn = \OC::$server->getUserSession()->isLoggedIn(); if ($loggedIn === true) { + if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor()) { + // Do not allow access to OCS until the 2FA challenge was solved successfully + return false; + } $ocsApiRequest = isset($_SERVER['HTTP_OCS_APIREQUEST']) ? $_SERVER['HTTP_OCS_APIREQUEST'] === 'true' : false; if ($ocsApiRequest) { |