Skip to content

Commit 09489b5

Browse files
authored
Merge pull request FriendsOfSymfony#2269 from gondo/patch-5
Considering users who disable CSRF protection for Symfony
2 parents 52ec294 + 4e9c821 commit 09489b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Controller/SecurityController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public function loginAction(Request $request)
5454
// last username entered by the user
5555
$lastUsername = (null === $session) ? '' : $session->get($lastUsernameKey);
5656

57-
$csrfToken = $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue();
57+
$csrfToken = $this->has('security.csrf.token_manager')
58+
? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue()
59+
: null;
5860

5961
return $this->renderLogin(array(
6062
'last_username' => $lastUsername,

0 commit comments

Comments
 (0)