Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid definition for service "Auth0\Symfony\Controllers\AuthenticationController": #189

Closed
4 tasks done
mkldevops opened this issue Jan 19, 2024 · 4 comments
Closed
4 tasks done

Comments

@mkldevops
Copy link

Checklist

  • I have looked into the Readme and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When I run following command :

APP_ENV=dev php console lint:container 

I have this error:

 [ERROR] Invalid definition for service "Auth0\Symfony\Controllers\AuthenticationController":                           
         "Auth0\Symfony\Controllers\AuthenticationController::__construct()" requires 3 arguments, 2 passed.            

Reproduction

  1. composer req auth0/symfony
  2. add on bundle on bundles.php file
  3. run the commade php bin/console lint:container

Additional context

No response

jwt-auth-bundle version

5.2.3

Symfony version

6.4

PHP version

8.3

@abunch
Copy link

abunch commented Mar 16, 2024

@evansims any chance you can approve/merge this PR?

@edent
Copy link
Contributor

edent commented Jun 19, 2024

Is there a way I can manually apply this patch to my installation?

@mkilmanas
Copy link
Contributor

@edent you can try switching over to elvi/auth0-symfony for now, which is the fork of this repository but with the open PRs merged in. Let's hope this official bundle catches up with the world eventually and we can all come back to use it again.

evansims added a commit that referenced this issue Jun 24, 2024
### Changes

Fix for issue #189

- Removed `$container` parameter from controllers (because it is
injected via `setContainer()` by Symfony DI)
- Added exception in psalm config not to report this as a problem

### References

#189

### Testing

Tested statically and on a Symfony 7.0 project (although controllers are
not executed there - verified that container builds without problems and
`bin/console list:container` reports no problems)

Tested only statically on Symfony 6.4.

Testing on older Symfony versions would be much appreciated.

[ ] This change adds test coverage

[x] This change has been tested on the latest version of Symfony

### Checklist

[x] I have read the [Auth0 general contribution
guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)

[x] I have read the [Auth0 Code of
Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

[x] All existing and new tests complete without errors

Co-authored-by: Evan Sims <[email protected]>
@evansims
Copy link
Member

The fix has shipped as part of 5.3.0; thanks for your work on this, as well as your other contributions, @mkilmanas. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants