|
18 | 18 | use Symfony\Component\DependencyInjection\Definition;
|
19 | 19 | use Symfony\Component\DependencyInjection\Extension\Extension;
|
20 | 20 | use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
| 21 | +use Symfony\Component\DependencyInjection\Parameter; |
21 | 22 | use Symfony\Component\DependencyInjection\Reference;
|
22 | 23 | use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
|
23 | 24 | use Symfony\UX\LiveComponent\ComponentValidator;
|
@@ -127,6 +128,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
|
127 | 128 | ->addTag('container.service_subscriber', ['key' => ComponentRenderer::class, 'id' => 'ux.twig_component.component_renderer'])
|
128 | 129 | ->addTag('container.service_subscriber', ['key' => LiveComponentHydrator::class, 'id' => 'ux.live_component.component_hydrator'])
|
129 | 130 | ->addTag('container.service_subscriber', ['key' => LiveComponentMetadataFactory::class, 'id' => 'ux.live_component.metadata_factory'])
|
| 131 | + ->addTag('container.service_subscriber') // csrf |
130 | 132 | ;
|
131 | 133 |
|
132 | 134 | $container->register('ux.live_component.live_responder', LiveResponder::class);
|
@@ -203,6 +205,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
|
203 | 205 | new Reference('ux.live_component.fingerprint_calculator'),
|
204 | 206 | new Reference('router'),
|
205 | 207 | new Reference('ux.live_component.live_responder'),
|
| 208 | + new Reference('security.csrf.token_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE), |
206 | 209 | new Reference('ux.live_component.twig.template_mapper'),
|
207 | 210 | ])
|
208 | 211 | ;
|
@@ -253,7 +256,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
|
253 | 256 | ->setArguments([
|
254 | 257 | new Reference('twig.template_iterator'),
|
255 | 258 | self::TEMPLATES_MAP_FILENAME,
|
256 |
| - '%kernel.secret%', |
| 259 | + new Parameter('container.build_hash'), |
257 | 260 | ])
|
258 | 261 | ->addTag('kernel.cache_warmer');
|
259 | 262 | }
|
|
0 commit comments