Skip to content

Commit

Permalink
[Security] updated with "intention"
Browse files Browse the repository at this point in the history
  • Loading branch information
kriswallsmith committed May 16, 2011
1 parent 914620f commit b645278
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -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);
}

Expand Down
Expand Up @@ -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);

Expand All @@ -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.');
}
}
Expand Down

0 comments on commit b645278

Please sign in to comment.