diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index c3bf2b995c4e2..07ec97da7b064 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -39,9 +39,9 @@ use OC\User\LoginException; use OCP\EventDispatcher\IEventDispatcher; use OCP\IGroupManager; +use OCP\ISession; use OCP\IUser; use OCP\IUserManager; -use OCP\IUserSession; use OCP\Server; use OCP\User\Events\BeforeUserLoggedInEvent; use OCP\User\Events\UserLoggedInEvent; @@ -339,7 +339,7 @@ public static function isAdminUser($uid) { * @return string|false uid or false */ public static function getUser() { - $uid = Server::get(IUserSession::class)->getUser()?->getUID(); + $uid = Server::get(ISession::class)?->get('user_id'); if (!is_null($uid) && self::$incognitoMode === false) { return $uid; } else {