RouteSubscriber.php in Simple Password Reset 8
File
src/Routing/RouteSubscriber.php
View source
<?php
namespace Drupal\simple_pass_reset\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
class RouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
$route = $collection
->get('user.reset');
if ($route) {
$route
->setDefaults([
'_title' => 'Choose a new password',
'_controller' => '\\Drupal\\simple_pass_reset\\Controller\\User::resetPass',
]);
$route
->setRequirement('_custom_access', '\\Drupal\\simple_pass_reset\\AccessChecks\\ResetPassAccessCheck::access');
}
}
}