<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*/
class OpenID extends BaseModule
{
- public static function content(array $parameters = [])
+ protected function content(array $request = []): string
{
if (DI::config()->get('system', 'no_openid')) {
DI::baseUrl()->redirect();
DI::auth()->setForUser(DI::app(), $user, true, true);
- // just in case there was no return url set
- // and we fell through
- DI::baseUrl()->redirect();
+ $this->baseUrl->redirect(DI::session()->pop('return_path', ''));
}
// Successful OpenID login - but we can't match it to an existing account.
$session->set('openid_identity', $authId);
// Detect the server URL
- $open_id_obj = new LightOpenID(DI::baseUrl()->getHostName());
+ $open_id_obj = new LightOpenID(DI::baseUrl()->getHostname());
$open_id_obj->identity = $authId;
$session->set('openid_server', $open_id_obj->discover($open_id_obj->identity));
DI::baseUrl()->redirect('login');
}
}
+
+ return '';
}
}