Skip to content

Commit 276a908

Browse files
authored
Update LiveComponentExtension.php
1 parent dec3eb3 commit 276a908

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LiveComponent/src/DependencyInjection/LiveComponentExtension.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\DependencyInjection\Definition;
1919
use Symfony\Component\DependencyInjection\Extension\Extension;
2020
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
21+
use Symfony\Component\DependencyInjection\Parameter;
2122
use Symfony\Component\DependencyInjection\Reference;
2223
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
2324
use Symfony\UX\LiveComponent\ComponentValidator;
@@ -127,6 +128,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
127128
->addTag('container.service_subscriber', ['key' => ComponentRenderer::class, 'id' => 'ux.twig_component.component_renderer'])
128129
->addTag('container.service_subscriber', ['key' => LiveComponentHydrator::class, 'id' => 'ux.live_component.component_hydrator'])
129130
->addTag('container.service_subscriber', ['key' => LiveComponentMetadataFactory::class, 'id' => 'ux.live_component.metadata_factory'])
131+
->addTag('container.service_subscriber') // csrf
130132
;
131133

132134
$container->register('ux.live_component.live_responder', LiveResponder::class);
@@ -203,6 +205,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
203205
new Reference('ux.live_component.fingerprint_calculator'),
204206
new Reference('router'),
205207
new Reference('ux.live_component.live_responder'),
208+
new Reference('security.csrf.token_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE),
206209
new Reference('ux.live_component.twig.template_mapper'),
207210
])
208211
;
@@ -253,7 +256,7 @@ function (ChildDefinition $definition, AsLiveComponent $attribute) {
253256
->setArguments([
254257
new Reference('twig.template_iterator'),
255258
self::TEMPLATES_MAP_FILENAME,
256-
'%kernel.secret%',
259+
new Parameter('container.build_hash'),
257260
])
258261
->addTag('kernel.cache_warmer');
259262
}

0 commit comments

Comments
 (0)