You are here

protected function RouteSubscriber::alterRoutes in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_authentication/src/Routing/RouteSubscriber.php \Drupal\ldap_authentication\Routing\RouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

ldap_authentication/src/Routing/RouteSubscriber.php, line 22

Class

RouteSubscriber
Authentication route subscriber.

Namespace

Drupal\ldap_authentication\Routing

Code

protected function alterRoutes(RouteCollection $collection) : void {
  if ($route = $collection
    ->get('user.pass')) {
    $route
      ->setRequirement('_custom_access', '\\Drupal\\ldap_authentication\\Routing\\RouteSubscriber::validateResetPasswordAllowed');
  }
}