]> git.mxchange.org Git - friendica-addons.git/commitdiff
Add DI::auth() call to windowsphonepush
authornupplaPhil <admin@philipp.info>
Sat, 28 Dec 2019 14:18:18 +0000 (15:18 +0100)
committernupplaPhil <admin@philipp.info>
Sat, 28 Dec 2019 14:18:18 +0000 (15:18 +0100)
windowsphonepush/windowsphonepush.php

index 242fe96db217cd7a563924d328269b1ff7174330..8d35e787cc86da6b5a60e78da84ca50f217ba975 100644 (file)
  */
 
 use Friendica\App;
-use Friendica\BaseObject;
 use Friendica\Content\Text\BBCode;
 use Friendica\Content\Text\HTML;
-use Friendica\App\Authentication;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
-use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Item;
 use Friendica\Model\User;
 
@@ -475,9 +473,7 @@ function windowsphonepush_login(App $a)
                die('This api requires login');
        }
 
-       /** @var Authentication $authentication */
-       $authentication = BaseObject::getClass(Authentication::class);
-       $authentication->setForUser($a, $record);
-       $_SESSION["allow_api"] = true;
+       DI::auth()->setForUser($a, $record);
+       DI::session()->set('allow_api', true);
        Hook::callAll('logged_in', $a->user);
 }