class CsrfTokenController implements ContainerInjectionInterface (View source)

Returns responses for CSRF token routes.

Properties

protected CsrfTokenGenerator $tokenGenerator

The CSRF token generator.

Methods

__construct(CsrfTokenGenerator $token_generator)

Constructs a new CsrfTokenController object.

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

Response
csrfToken()

Returns a CSRF protecting session token.

Details

__construct(CsrfTokenGenerator $token_generator)

Constructs a new CsrfTokenController object.

Parameters

CsrfTokenGenerator $token_generator

The CSRF token generator.

static create(ContainerInterface $container)

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this instance should use.

Response csrfToken()

Returns a CSRF protecting session token.

Return Value

Response

The response object.