37 lines
997 B
PHP
37 lines
997 B
PHP
<?php declare(strict_types=1);
|
|
|
|
use Symfony\Config\SecurityConfig;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator, SecurityConfig $security): void {
|
|
$security->passwordHasher(PasswordAuthenticatedUserInterface::class, 'auto')
|
|
;
|
|
|
|
$containerConfigurator->extension('security', [
|
|
'providers' => [
|
|
'users_in_memory' => [
|
|
'memory' => null]
|
|
],
|
|
'firewalls' => [
|
|
'dev' => [
|
|
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
|
|
'security' => false
|
|
],
|
|
'main' => [
|
|
'lazy' => true,
|
|
'provider' => 'users_in_memory'
|
|
]
|
|
],
|
|
'access_control' => null
|
|
]);
|
|
if ($containerConfigurator->env() === 'test') {
|
|
$security->passwordHasher(PasswordAuthenticatedUserInterface::class, [
|
|
'algorithm' => 'auto',
|
|
'cost' => 4,
|
|
'time_cost' => 3,
|
|
'memory_cost' => 10
|
|
]);
|
|
}
|
|
};
|