Skip to content

Commit

Permalink
Handle login in old ajax endpoints which use OCP\JSON::checkLoggedIn();
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Feb 26, 2018
1 parent 7c5fb15 commit 6345d06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/private/legacy/json.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public static function checkAppEnabled($app) {
* @deprecated Use annotation based ACLs from the AppFramework instead
*/
public static function checkLoggedIn() {
static $loginCalled = false;
if (!$loginCalled) {
\OC::handleLogin(\OC::$server->getRequest());
$loginCalled = true;
}

$twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
if( !OC_User::isLoggedIn()
|| $twoFactorAuthManger->needsSecondFactor()) {
Expand Down

0 comments on commit 6345d06

Please sign in to comment.