You are here

public function DeprecatedCsrfTokenController::csrfToken in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/csrf_test/src/Controller/DeprecatedCsrfTokenController.php \Drupal\csrf_test\Controller\DeprecatedCsrfTokenController::csrfToken()

Returns a CSRF using the deprecated 'rest' value protecting session token.

Return value

\Symfony\Component\HttpFoundation\Response The response object.

1 string reference to 'DeprecatedCsrfTokenController::csrfToken'
csrf_test.routing.yml in core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml

File

core/modules/system/tests/modules/csrf_test/src/Controller/DeprecatedCsrfTokenController.php, line 53

Class

DeprecatedCsrfTokenController
Returns responses for Deprecated CSRF token routes.

Namespace

Drupal\csrf_test\Controller

Code

public function csrfToken() {
  return new Response($this->tokenGenerator
    ->get('rest'), 200, [
    'Content-Type' => 'text/plain',
  ]);
}