Browse Source

Move 'Authentication' to Security namespace

pull/9327/head
Philipp 3 weeks ago
parent
commit
3a52179393
No known key found for this signature in database GPG Key ID: 9A28B7D4FF5667BD
4 changed files with 17 additions and 13 deletions
  1. +1
    -1
      index.php
  2. +1
    -1
      src/App.php
  3. +12
    -8
      src/DI.php
  4. +3
    -3
      src/Security/Authentication.php

+ 1
- 1
index.php View File

@@ -38,6 +38,6 @@ $a->runFrontend(
$dice->create(\Friendica\App\Module::class),
$dice->create(\Friendica\App\Router::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)
);

+ 1
- 1
src/App.php View File

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


+ 12
- 8
src/DI.php View File

@@ -63,14 +63,6 @@ abstract class DI
// "App" namespace instances
//

/**
* @return App\Authentication
*/
public static function auth()
{
return self::$dice->create(App\Authentication::class);
}

/**
* @return App\Arguments
*/
@@ -406,6 +398,18 @@ abstract class DI
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
//


src/App/Authentication.php → src/Security/Authentication.php View File

@@ -19,7 +19,7 @@
*
*/

namespace Friendica\App;
namespace Friendica\Security;

use Exception;
use Friendica\App;
@@ -41,7 +41,7 @@ use Friendica\Core\L10n;
use Psr\Log\LoggerInterface;

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

Loading…
Cancel
Save