]> git.mxchange.org Git - friendica-addons.git/commitdiff
Refactor "Authentication" class with four main methods:
authornupplaPhil <admin@philipp.info>
Tue, 3 Dec 2019 21:29:36 +0000 (22:29 +0100)
committernupplaPhil <admin@philipp.info>
Tue, 3 Dec 2019 21:29:36 +0000 (22:29 +0100)
- 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

index 30c6cf60f399642b1e705d5d017a1b6a3400965f..53eb3cdc0ad7c1c30062557b4dadc999171d4fe0 100644 (file)
  */
 
 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);
 }