From b645278f8b59ad9bffd13ccfdbb86d828264f737 Mon Sep 17 00:00:00 2001 From: Kris Wallsmith Date: Mon, 16 May 2011 14:11:34 -0700 Subject: [PATCH] [Security] updated with "intention" --- .../DependencyInjection/Security/Factory/FormLoginFactory.php | 2 +- .../Firewall/UsernamePasswordFormAuthenticationListener.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php index e23b4d52b905..7e9eaf7d7ee9 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php @@ -30,7 +30,7 @@ public function __construct() $this->addOption('username_parameter', '_username'); $this->addOption('password_parameter', '_password'); $this->addOption('csrf_parameter', '_csrf_token'); - $this->addOption('csrf_page_id', 'form_login'); + $this->addOption('intention', 'authenticate'); $this->addOption('post_only', true); } diff --git a/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php index 4ad456c8da22..51546c0da589 100644 --- a/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php @@ -42,7 +42,7 @@ public function __construct(SecurityContextInterface $securityContext, Authentic 'username_parameter' => '_username', 'password_parameter' => '_password', 'csrf_parameter' => '_csrf_token', - 'csrf_page_id' => 'form_login', + 'intention' => 'authenticate', 'post_only' => true, ), $options), $successHandler, $failureHandler, $logger, $dispatcher); @@ -65,7 +65,7 @@ protected function attemptAuthentication(Request $request) if (null !== $this->csrfProvider) { $csrfToken = $request->get($this->options['csrf_parameter']); - if (false === $this->csrfProvider->isCsrfTokenValid($this->options['csrf_page_id'], $csrfToken)) { + if (false === $this->csrfProvider->isCsrfTokenValid($this->options['intention'], $csrfToken)) { throw new InvalidCsrfTokenException('Invalid CSRF token.'); } }