Commit 77e86f11 authored by Fabien Potencier's avatar Fabien Potencier

fixed CS

parent 682e1a56
......@@ -16,7 +16,6 @@ Services
`CsrfTokenManagerInterface
<http://api.symfony.com/master/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.html>`_,
Registering
-----------
......@@ -42,12 +41,13 @@ Usage
When the CSRF Service Provider is registered, all forms created via the Form
Service Provider are protected against CSRF by default.
You can also use the CSRF protection even without using the Symfony Form
component. If, for example, you're doing a DELETE action, you can create a token::
You can also use the CSRF protection without using the Symfony Form component.
If, for example, you're doing a DELETE action, create a CSRF token to use in
your code::
use Symfony\Component\Security\Csrf\CsrfToken;
$csrfToken = $app['csrf.token_manager']->getToken('token_id'); //'TOKEN'
then you can check the CSRF token::
Then check it::
$app['csrf.token_manager']->isTokenValid(new CsrfToken('token_id', 'TOKEN'));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment