markitosgv / JWTRefreshTokenBundle

Implements a Refresh Token system over Json Web Tokens in Symfony
MIT License
663 stars 159 forks source link

Unable to find the controller for path \"/api/token/refresh\". The route is wrongly configured. #376

Closed mlcpro closed 6 months ago

mlcpro commented 9 months ago

Hello in Symfony 6 it seems that the controller is not supported with the /api... route can you update the bundle please

jewome62 commented 8 months ago

No problem in symfony 6 and 7 with that in routes.yaml

api_refresh_token:
    path: /api/token/refresh
noxerlito commented 7 months ago

I had the same issue and I found a solution by not using the route name in the check_path, use the path directly instead

firewalls:
        api:
            pattern: ^/api
            stateless: true
            entry_point: jwt
            json_login:
                check_path: /api/login # or, if you have defined a route for your login path, the route name you used
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            jwt: ~
            refresh_jwt:
                check_path: /api/token/refresh