diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 52f8d644a87..c1b940e92a3 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -505,7 +505,7 @@ and add the following logic:: $csrfToken = $request->request->get('_csrf_token'); if (false === $this->csrfTokenManager->isTokenValid(new CsrfToken('authenticate', $csrfToken))) { - throw new InvalidCsrfTokenException('Invalid CSRF token.'); + return null; } // ... all your normal logic