Skip to content

Commit deb6efa

Browse files
FRW-10640 Fixed red CI. (#93)
FRW-10640 Fixed red CI.
1 parent 2e4abb3 commit deb6efa

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Spryker/Yves/Security/Plugin/Application/SecurityApplicationPlugin.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ protected function addAuthenticationFailureHandlerPrototype(ContainerInterface $
10931093
$container->set(static::SERVICE_SECURITY_AUTHENTICATION_FAILURE_HANDLER_PROTO, $container->protect(function ($name, $options) use ($container) {
10941094
return function () use ($options, $container) {
10951095
return new DefaultAuthenticationFailureHandler(
1096-
$container->get(static::SERVICE_KERNEL),
1096+
$this->getKernelService($container),
10971097
$container->get(static::SERVICE_SECURITY_HTTP_UTILS),
10981098
$options,
10991099
$this->getLogger($container),
@@ -1481,7 +1481,7 @@ protected function addEntryPointFormPrototype(ContainerInterface $container): Co
14811481
$loginPath = $options['login_path'] ?? '/login';
14821482
$useForward = $options['use_forward'] ?? false;
14831483

1484-
return new FormAuthenticationEntryPoint($container->get(static::SERVICE_KERNEL), $container->get(static::SERVICE_SECURITY_HTTP_UTILS), $loginPath, $useForward);
1484+
return new FormAuthenticationEntryPoint($this->getKernelService($container), $container->get(static::SERVICE_SECURITY_HTTP_UTILS), $loginPath, $useForward);
14851485
};
14861486
}));
14871487

@@ -1770,4 +1770,17 @@ protected function initializeAuthenticationListenerFactoryTypes(): void
17701770
);
17711771
}
17721772
}
1773+
1774+
/**
1775+
* @param \Spryker\Service\Container\ContainerInterface $container
1776+
*
1777+
* @return mixed
1778+
*/
1779+
protected function getKernelService(ContainerInterface $container)
1780+
{
1781+
// Fallback for backward compatibility with older Symfony versions
1782+
return $container->has(static::SERVICE_KERNEL)
1783+
? $container->get(static::SERVICE_KERNEL)
1784+
: $container->get('http_kernel');
1785+
}
17731786
}

0 commit comments

Comments
 (0)