diff --git a/lib/private/api.php b/lib/private/api.php index 26091657b3..0576f3e3f9 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -250,7 +250,8 @@ class OC_API { // reuse existing login $loggedIn = OC_User::isLoggedIn(); - if ($loggedIn === true) { + $ocsApiRequest = isset($_SERVER['OCS_APIREQUEST']) ? $_SERVER['OCS_APIREQUEST'] === 'true' : false; + if ($loggedIn === true && $ocsApiRequest) { return OC_User::getUser(); }