You are here

CasRouteSubscriber.php in CAS 8

Same filename and directory in other branches
  1. 2.x src/Subscriber/CasRouteSubscriber.php

File

src/Subscriber/CasRouteSubscriber.php
View source
<?php

namespace Drupal\cas\Subscriber;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Alters the user password reset routes.
 */
class CasRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    foreach ([
      'user.pass',
      'user.pass.http',
    ] as $route_name) {
      $collection
        ->get($route_name)
        ->setRequirement('_cas_user_access', 'TRUE');
    }
  }

}

Classes

Namesort descending Description
CasRouteSubscriber Alters the user password reset routes.