Use `OCP\User::checkLoggedIn();` instead.