CsrfAccessCheck
class CsrfAccessCheck implements AccessInterface (View source)
Allows access to routes to be controlled by a '_csrf_token' parameter.
To use this check, add a "token" GET parameter to URLs of which the value is a token generated by \Drupal::csrfToken()->get() using the same value as the "_csrf_token" parameter in the route.
Properties
| protected CsrfTokenGenerator | $csrfToken | The CSRF token generator. |
Methods
access(Route $route, Request $request, RouteMatchInterface $route_match)
Checks access based on a CSRF token for the request.
Details
__construct(CsrfTokenGenerator $csrf_token)
Constructs a CsrfAccessCheck object.
AccessResultInterface
access(Route $route, Request $request, RouteMatchInterface $route_match)
Checks access based on a CSRF token for the request.