8000 bug #34786 [SecurityBundle] Use config variable in AnonymousFactory (… · symfony/symfony@120f32c · GitHub
[go: up one dir, main page]

Skip to content

Commit 120f32c

Browse files
author
Robin Chalas
committed
bug #34786 [SecurityBundle] Use config variable in AnonymousFactory (martijnboers)
This PR was merged into the 4.4 branch. Discussion ---------- [SecurityBundle] Use config variable in AnonymousFactory | Q | A | ------------- | --- | Branch? | 4.4 and 5.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT It looks like the `AnonymousFactory` was copied incorrectly in #33503 as it uses the old `$firewall` variable available in `SecurityExtension.php`. Changing this to `$config` yields the desired results Commits ------- 8d850d2 When set, get secret from config variable
2 parents c01a583 + 8d850d2 commit 120f32c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AnonymousFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ class AnonymousFactory implements SecurityFactoryInterface
2424
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
2525
{
2626
if (null === $config['secret']) {
27-
$firewall['anonymous']['secret'] = new Parameter('container.build_hash');
27+
$config['secret'] = new Parameter('container.build_hash');
2828
}
2929

3030
$listenerId = 'security.authentication.listener.anonymous.'.$id;
3131
$container
3232
->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.anonymous'))
33-
->replaceArgument(1, $firewall['anonymous']['secret'])
33+
->replaceArgument(1, $config['secret'])
3434
;
3535

3636
$providerId = 'security.authentication.provider.anonymous.'.$id;
3737
$container
3838
->setDefinition($providerId, new ChildDefinition('security.authentication.provider.anonymous'))
39-
->replaceArgument(0, $firewall['anonymous']['secret'])
39+
->replaceArgument(0, $config['secret'])
4040
;
4141

4242
return [$providerId, $listenerId, $defaultEntryPoint];

0 commit comments

Comments
 (0)
0