You are here

class TfaRouteSubscriber in Two-factor Authentication (TFA) 8

Listens to the dynamic route events.

Class TfaRouteSubscriber.

@package Drupal\tfa\Routing


Expanded class hierarchy of TfaRouteSubscriber

1 string reference to 'TfaRouteSubscriber' in ./
1 service uses TfaRouteSubscriber
tfa.route_subscriber in ./


src/Routing/TfaRouteSubscriber.php, line 15


View source
class TfaRouteSubscriber extends RouteSubscriberBase {

   * Overrides user.login route with our custom login form.
   * @param \Symfony\Component\Routing\RouteCollection $collection
   *   Route to be altered.
  public function alterRoutes(RouteCollection $collection) {

    // Change path of user login to our overridden TFA login form.
    if ($route = $collection
      ->get('user.login')) {
        ->setDefault('_form', '\\Drupal\\tfa\\Form\\TfaLoginForm');



Namesort descending Modifiers Type Description Overrides
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1
TfaRouteSubscriber::alterRoutes public function Overrides user.login route with our custom login form. Overrides RouteSubscriberBase::alterRoutes