Issue #3227108 by chmez: Use Auth service in route subscriber service
requested to merge issue/zoho_crm_integration-3227108:bugfix/3227108-auth-service-in-route-subscriber into 8.x-1.x
Problem
It is not possible in this case because the constructor of the Auth service tries to use the settings form route when it is not created yet.
Solution
Create a separate method for getting redirection URL.
Issue tracker
- https://www.drupal.org/project/zoho_crm_integration/issues/3227108
- https://getopensocial.atlassian.net/browse/YANG-6014
How to test
-
Create a new module. -
Add route subscriber service to the created module. -
Add the Auth service as injected service. -
When you try to enable the module then you should see the following error:
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "zoho_crm_integration.settings" does not exist. in /var/www/html/core/lib/Drupal/Core/Routing/RouteProvider.php:208
Edited by Oleksandr Horbatiuk