You are here

private function AccessDeniedSubscriber::getCurrentRouteName in SAML Authentication 8.3

Same name and namespace in other branches
  1. 4.x src/EventSubscriber/AccessDeniedSubscriber.php \Drupal\samlauth\EventSubscriber\AccessDeniedSubscriber::getCurrentRouteName()

Gets the current route name.

Parameters

\Symfony\Component\HttpKernel\Event\KernelEvent $event: The event we're subscribed to.

Return value

string The current route name.

1 call to AccessDeniedSubscriber::getCurrentRouteName()
AccessDeniedSubscriber::onException in src/EventSubscriber/AccessDeniedSubscriber.php
Redirects users when access is denied.

File

src/EventSubscriber/AccessDeniedSubscriber.php, line 91

Class

AccessDeniedSubscriber
Exception subscriber intercepting various "access denied" situations.

Namespace

Drupal\samlauth\EventSubscriber

Code

private function getCurrentRouteName(KernelEvent $event) {

  // This method is just a reminder: we can either get the current request
  // from the event, or we can inject the current_route_match service if ever
  // necessary. There seems to be no consensus on what is 'better'.
  return RouteMatch::createFromRequest($event
    ->getRequest())
    ->getRouteName();
}