Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae4d588

Browse files
committed
[SecurityBundle] Use the csrf_token_id instead of the deprecated intention
1 parent a4823b7 commit ae4d588

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* deprecated the `key` setting of `anonymous`, `remember_me` and `http_digest`
88
in favor of the `secret` setting.
9+
* deprecated the `intention` firewall listener setting in favor of the `csrf_token_id`.
910

1011
2.6.0
1112
-----

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct()
2929
$this->addOption('username_parameter', '_username');
3030
$this->addOption('password_parameter', '_password');
3131
$this->addOption('csrf_parameter', '_csrf_token');
32-
$this->addOption('intention', 'authenticate');
32+
$this->addOption('csrf_token_id', 'authenticate');
3333
$this->addOption('post_only', true);
3434
}
3535

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
299299
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.logout_listener'));
300300
$listener->replaceArgument(3, array(
301301
'csrf_parameter' => $firewall['logout']['csrf_parameter'],
302-
'intention' => $firewall['logout']['csrf_token_id'],
302+
'csrf_token_id' => $firewall['logout']['csrf_token_id'],
303303
'logout_path' => $firewall['logout']['path'],
304304
));
305305
$listeners[] = new Reference($listenerId);

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7979
*/
8080
public function configureOptions(OptionsResolver $resolver)
8181
{
82-
/* Note: the form's intention must correspond to that for the form login
82+
/* Note: the form's csrf_token_id must correspond to that for the form login
8383
* listener in order for the CSRF token to validate successfully.
8484
*/
8585

8686
$resolver->setDefaults(array(
87-
'intention' => 'authenticate',
87+
'csrf_token_id' => 'authenticate',
8888
));
8989
}
9090
}

0 commit comments

Comments
 (0)