mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-22 16:51:20 +00:00
29 lines
597 B
PHP
29 lines
597 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Auth\Config;
|
|
|
|
use CodeIgniter\Shield\Authentication\Authentication;
|
|
use Config\Services as BaseService;
|
|
use Modules\Auth\Auth;
|
|
use Modules\Auth\Config\Auth as AuthConfig;
|
|
|
|
class Services extends BaseService
|
|
{
|
|
/**
|
|
* The base auth class
|
|
*/
|
|
public static function auth(bool $getShared = true): Auth
|
|
{
|
|
if ($getShared) {
|
|
/** @var Auth */
|
|
return self::getSharedInstance('auth');
|
|
}
|
|
|
|
$config = config(AuthConfig::class);
|
|
|
|
return new Auth(new Authentication($config));
|
|
}
|
|
}
|