majid-rafei / Mezzio-OAuth2-Server

This is a basic Oauth2 authorization/authentication server implemented using Mezzio.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Duplicate route DuplicateRouteException #2

Open majid-rafei opened 2 years ago

majid-rafei commented 2 years ago

In case:

Fatal error:
Uncaught Mezzio\Router\Exception\DuplicateRouteException: Duplicate route detected; path "/oauth"
answering to methods [GET,POST], with name "oauth" in
/var/www/mezzio/vendor/laminas/laminas-servicemanager/src/ServiceManager.php 
majid-rafei commented 2 years ago

Refer to duplicate route, please check if ApplicationConfigInjectionDelegator is used anywhere in your config provider files. Something like below:

'delegators' => [
    \Mezzio\Application::class => [
        \Mezzio\Container\ApplicationConfigInjectionDelegator::class,
    ]
],
majid-rafei commented 2 years ago

Please aware that config below is set in dependencies.global.php file in dependencies key:

'delegators' => [
    \Mezzio\Application::class => [
        \Mezzio\Container\ApplicationConfigInjectionDelegator::class,
    ]
],