JWTRefreshTokenBundle: Error in RefreshTokenManager - Support for doctrine/common +3.0
Since Doctrine Common 3.0, Common was split into smaller packages.
Actually in RefreshTokenManager you inject Doctrine\Common\Persistence\ObjectManager in constructor.
Since Doctrine Common 3.0, Doctrine\Common\Persistence\ObjectManager became Doctrine\Persistence\ObjectManager.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 30
- Comments: 25 (7 by maintainers)
Commits related to this issue
- Add doctrine/common 3+ support, close #200. — committed to Invis1bleReborn/JWTRefreshTokenBundle by Invis1bleReborn 4 years ago
- Merge pull request #1 from Invis1bleReborn/fix-200 Add doctrine/common 3+ support, close #200. — committed to whatwedo/JWTRefreshTokenBundle by lukasluecke 4 years ago
Hello. Faced the same problem, my solution is:
Hello @markitosgv
There are 5 PR to address this issue:
Could you merge one of theses please ?
And if you donβt have time for this, this not a big deal. But Could you give write permissions to someone else? ππΌ
Have a nice day
A simpler approach until this is fixed upstream:
override the service:
and on the class just override the contructor
Adding the relevant error for the people coming from google:
Argument 1 passed to Gesdinet\\JWTRefreshTokenBundle\\Doctrine\\RefreshTokenManager::__construct() must be an instance of Doctrine\\Common\\Persistence\\ObjectManager, instance of Doctrine\\ORM\\EntityManager given, called in \getGesdinet_Jwtrefreshtoken_RefreshTokenManagerService.php on line 24Solved in v0.10.0, please confirm that!
Any idea when this will be fixed?
I hope that this gets merged soon π For the ones using PHPStan (based on @byhaskell):
@acasademont your shorter solution works like charm, thanks and kudos!
I can confirm that the solution provided by @byhaskell works out of the box. Thanks !
Thank You @byhaskell . Added the config to services in config/services.yaml and it worked like a charm.