Skip to content

Commit 2643342

Browse files
committed
Fixed crash when CSRF is disabled
1 parent ff3f85b commit 2643342

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Controller/SecurityController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function loginAction()
4040
// last username entered by the user
4141
$lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME);
4242

43-
$csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');
43+
$csrfToken = $this->container->has('form.csrf_provider') ? $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate') : null;
4444

4545
return $this->renderLogin(array(
4646
'last_username' => $lastUsername,

0 commit comments

Comments
 (0)