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

Skip to content

Commit b194912

Browse files
committed
[SecurityBundle] Use csrf_token_id instead of deprecated intention
1 parent 953ed3c commit b194912

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct()
3030
$this->addOption('password_parameter', '_password');
3131
$this->addOption('csrf_parameter', '_csrf_token');
3232
$this->addOption('intention', 'authenticate');
33+
$this->addOption('csrf_token_id', 'authenticate');
3334
$this->addOption('post_only', true);
3435
}
3536

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ 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(
8787
'intention' => 'authenticate',
88+
'csrf_token_id' => 'authenticate',
8889
));
8990
}
9091
}

0 commit comments

Comments
 (0)