Skip to content

Commit

Permalink
Remove session security listener if values are not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny van Wijk committed Nov 21, 2024
1 parent 8f1601b commit b1c7365
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function load(array $configs, ContainerBuilder $container): void
}

$this->registerExceptionLoggingConfiguration($config['exception_logging'], $container);
$this->removeSessionSecurityListener($config, $container);

$container->setParameter('kunstmaan_admin.default_locale', $config['default_locale']);
$container->setParameter('kunstmaan_admin.website_title', $config['website_title']);
Expand Down Expand Up @@ -137,6 +138,15 @@ private function registerExceptionLoggingConfiguration(array $config, ContainerB
$definition->setArgument(2, false);
}

private function removeSessionSecurityListener(array $config, ContainerBuilder $container): void
{
if ($config['session_security']['ip_check'] || $config['session_security']['user_agent_check']) {
return;
}

$container->removeDefinition('kunstmaan_admin.session_security');
}

private function configureAuthentication(array $config, ContainerBuilder $container, LoaderInterface $loader): void
{
$container->setParameter('kunstmaan_admin.enable_new_cms_authentication', true);
Expand Down

0 comments on commit b1c7365

Please sign in to comment.