From 7b47bdc409d47c082a7a0c7c5d9713ba9606d9b1 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 9 Dec 2023 19:42:52 +0100 Subject: [PATCH] Add `#[IsCsrfTokenValid]` to attributes reference --- reference/attributes.rst | 1 + security/csrf.rst | 2 ++ 2 files changed, 3 insertions(+) diff --git a/reference/attributes.rst b/reference/attributes.rst index cf21c5a7c45..f61c78b9a3a 100644 --- a/reference/attributes.rst +++ b/reference/attributes.rst @@ -80,6 +80,7 @@ Security ~~~~~~~~ * :ref:`CurrentUser ` +* :ref:`IsCsrfTokenValid ` * :ref:`IsGranted ` Serializer diff --git a/security/csrf.rst b/security/csrf.rst index 2e2197f1547..0352d7e6f87 100644 --- a/security/csrf.rst +++ b/security/csrf.rst @@ -164,6 +164,8 @@ method to check its validity:: } } +.. _csrf-controller-attributes: + Alternatively you can use the :class:`Symfony\\Component\\Security\\Http\\Attribute\\IsCsrfTokenValid` attribute on the controller action::