From c62774f6d2d597d57284ba5a211ea33bd0cc9f17 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 3 Dec 2019 22:29:36 +0100 Subject: [PATCH] Refactor "Authentication" class with four main methods: - withSession() - for auto authentication with Session/Cookie variables - withOpenId() - for authentication with an OpenID account - withPassword() - for authentication with Password - setForUser() - for setting the user auth context of the current session Refactor "Session" class - contains now "native" Session Management methods --- windowsphonepush/windowsphonepush.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 30c6cf60..53eb3cdc 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -27,8 +27,10 @@ */ use Friendica\App; +use Friendica\BaseObject; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; +use Friendica\Core\Authentication; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; @@ -473,7 +475,9 @@ function windowsphonepush_login(App $a) die('This api requires login'); } - Session::setAuthenticatedForUser($a, $record); + /** @var Authentication $authentication */ + $authentication = BaseObject::getClass(Authentication::class); + $authentication->setForUser($a, $record); $_SESSION["allow_api"] = true; Hook::callAll('logged_in', $a->user); }