Move 'Authentication' to Security namespace

This commit is contained in:
Philipp Holzer 2020-09-30 16:53:18 +02:00
parent ad34abda1a
commit 3a52179393
No known key found for this signature in database
GPG Key ID: 9A28B7D4FF5667BD
4 changed files with 17 additions and 13 deletions

View File

@ -38,6 +38,6 @@ $a->runFrontend(
$dice->create(\Friendica\App\Module::class), $dice->create(\Friendica\App\Module::class),
$dice->create(\Friendica\App\Router::class), $dice->create(\Friendica\App\Router::class),
$dice->create(\Friendica\Core\PConfig\IPConfig::class), $dice->create(\Friendica\Core\PConfig\IPConfig::class),
$dice->create(\Friendica\App\Authentication::class), $dice->create(\Friendica\Security\Authentication::class),
$dice->create(\Friendica\App\Page::class) $dice->create(\Friendica\App\Page::class)
); );

View File

@ -24,7 +24,7 @@ namespace Friendica;
use Exception; use Exception;
use Friendica\App\Arguments; use Friendica\App\Arguments;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\App\Authentication; use Friendica\Security\Authentication;
use Friendica\Core\Config\Cache; use Friendica\Core\Config\Cache;
use Friendica\Core\Config\IConfig; use Friendica\Core\Config\IConfig;
use Friendica\Core\PConfig\IPConfig; use Friendica\Core\PConfig\IPConfig;

View File

@ -63,14 +63,6 @@ abstract class DI
// "App" namespace instances // "App" namespace instances
// //
/**
* @return App\Authentication
*/
public static function auth()
{
return self::$dice->create(App\Authentication::class);
}
/** /**
* @return App\Arguments * @return App\Arguments
*/ */
@ -406,6 +398,18 @@ abstract class DI
return self::$dice->create(Protocol\Activity::class); return self::$dice->create(Protocol\Activity::class);
} }
//
// "Security" namespace instances
//
/**
* @return \Friendica\Security\Authentication
*/
public static function auth()
{
return self::$dice->create(Security\Authentication::class);
}
// //
// "Util" namespace instances // "Util" namespace instances
// //

View File

@ -19,7 +19,7 @@
* *
*/ */
namespace Friendica\App; namespace Friendica\Security;
use Exception; use Exception;
use Friendica\App; use Friendica\App;
@ -41,7 +41,7 @@ use Friendica\Core\L10n;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
/** /**
* Handle Authentification, Session and Cookies * Handle Authentication, Session and Cookies
*/ */
class Authentication class Authentication
{ {
@ -374,7 +374,7 @@ class Authentication
* that expires after one week (the default is when the browser is closed). * that expires after one week (the default is when the browser is closed).
* The cookie will be renewed automatically. * The cookie will be renewed automatically.
* The week ensures that sessions will expire after some inactivity. * The week ensures that sessions will expire after some inactivity.
*/; */
if ($this->session->get('remember')) { if ($this->session->get('remember')) {
$this->logger->info('Injecting cookie for remembered user ' . $user_record['nickname']); $this->logger->info('Injecting cookie for remembered user ' . $user_record['nickname']);
$this->cookie->set($user_record['uid'], $user_record['password'], $user_record['prvkey']); $this->cookie->set($user_record['uid'], $user_record['password'], $user_record['prvkey']);