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
This commit is contained in:
parent
18a3d18ba6
commit
96555a7385
13 changed files with 386 additions and 301 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Authentication;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -21,7 +22,9 @@ use Friendica\Util\XML;
|
|||
|
||||
function dfrn_poll_init(App $a)
|
||||
{
|
||||
Authentication::sessionAuth();
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = BaseObject::getClass(Authentication::class);
|
||||
$authentication->withSession($a, $_COOKIE);
|
||||
|
||||
$dfrn_id = $_GET['dfrn_id'] ?? '';
|
||||
$type = ($_GET['type'] ?? '') ?: 'data';
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Authentication;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
|
@ -45,7 +47,9 @@ function openid_content(App $a) {
|
|||
|
||||
unset($_SESSION['openid']);
|
||||
|
||||
Session::setAuthenticatedForUser($a, $user, true, true);
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = BaseObject::getClass(Authentication::class);
|
||||
$authentication->setForUser($a, $user, true, true);
|
||||
|
||||
// just in case there was no return url set
|
||||
// and we fell through
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue