-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SD-375] Added services and routesubscriber.
- Loading branch information
1 parent
f2abe73
commit 08395fa
Showing
4 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Drupal\tide_tfa\Routing; | ||
|
||
use Drupal\Core\Routing\RouteSubscriberBase; | ||
use Symfony\Component\Routing\RouteCollection; | ||
|
||
/** | ||
* Listens to the dynamic route events. | ||
* | ||
* Class TideTfaRouteSubscriber. | ||
* | ||
* @package Drupal\tide_tfa\Routing | ||
*/ | ||
class TideTfaRouteSubscriber extends RouteSubscriberBase { | ||
|
||
/** | ||
* Alters existing routes for TFA user password reset login. | ||
* | ||
* @param \Symfony\Component\Routing\RouteCollection $collection | ||
* Route collection to be altered. | ||
*/ | ||
protected function alterRoutes(RouteCollection $collection) { | ||
// Override the user reset pass login route to use TideTfaUserController. | ||
if ($route = $collection->get('user.reset.login')) { | ||
$route->setDefault('_controller', '\Drupal\tide_tfa\Controller\TideTfaUserController::doResetPassLogin'); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
services: | ||
tide_tfa.route_subscriber: | ||
class: Drupal\tide_tfa\Routing\TideTfaRouteSubscriber | ||
tags: | ||
- { name: event_subscriber } |