You are here

public function DefaultExceptionHtmlSubscriber::on401 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on401()

Handles a 401 error for HTML.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event: The event to process.

File

core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php, line 85
Contains \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber.

Class

DefaultExceptionHtmlSubscriber
Exception subscriber for handling core default HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on401(GetResponseForExceptionEvent $event) {
  $this
    ->makeSubrequest($event, Url::fromRoute('system.401')
    ->toString(), Response::HTTP_UNAUTHORIZED);
}