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
Error in RefreshTokenManager - Support for doctrine/common +3.0 #200
Comments
Hello. Faced the same problem, my solution is:
|
Adding the relevant error for the people coming from google:
|
Thank You @byhaskell . Added the config to services in config/services.yaml and it worked like a charm. |
I can confirm that the solution provided by @byhaskell works out of the box. Thanks ! |
When will this be merged and released? @markitosgv |
I hope that this gets merged soon ;)
|
Yea, stuck with this problem in doctrine/mongodb-odm. |
Same problem :( |
|
Any idea when this will be fixed? |
Add doctrine/common 3+ support, close markitosgv#200.
A simpler approach until this is fixed upstream: override the service: gesdinet.jwtrefreshtoken.refresh_token_manager:
class: App\Doctrine\RefreshTokenManager
public: true
arguments: [ '@gesdinet.jwtrefreshtoken.object_manager', '%gesdinet.jwtrefreshtoken.refresh_token.class%' ] and on the class just override the contructor <?php
namespace App\Doctrine;
use Doctrine\Persistence\ObjectManager;
class RefreshTokenManager extends \Gesdinet\JWTRefreshTokenBundle\Doctrine\RefreshTokenManager
{
public function __construct(ObjectManager $om, $class)
{
$this->objectManager = $om;
$this->repository = $om->getRepository($class);
$metadata = $om->getClassMetadata($class);
$this->class = $metadata->getName();
}
} |
@acasademont if you do that, be careful to use the right namespace in the In your example, the Those 2 values should match. |
Ah yes, sure, I just wanted to change the namespace for the example and I
forgot to change it on the php file, thanks for noticing! The original is
ok!
…On Fri, Nov 6, 2020 at 12:13 PM Mickael GOETZ ***@***.***> wrote:
@acasademont <https://github.com/acasademont> if you do that, be careful
to use the right namespace in the class property of your YAML definition.
In your example, the class of you YAML is App\Doctrine\RefreshTokenManager
and the FQDN of the PHP class you provide is
App\Infrastructure\Share\Doctrine\RefreshTokenManager.
Those 2 values should match.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#200 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGJNPNRBGAPRX5LICO52R3SOPK67ANCNFSM4QL276EA>
.
|
@byhaskell yeah, excellent that worked for me, thanks!!... I hope the team merges this soon!! Regards!!! |
I had the same problem and I confirm that @byhaskell solution is the right one. Thank you! |
@acasademont your shorter solution works like charm, thanks and kudos! |
The @acasademont solution works perfectly. Thank you Waiting the merge :) |
Thx for the solution. I hope the PR will get merge as soon as possible. |
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 |
Thank you @byhaskell. Worked perfectly. |
EDIT : got it. you need to place the new RefreshTokenManager class in the right place. in my case : src/Doctrine/RefreshTokenManager/RefreshTokenManager.php . You can see in the service.yaml that its loaded and placed in the right path. Thanks @ all it now works for me Hi, first of all thank you all for your insights.
my services.yaml looks like this- `
` And i created the folders "App/Doctrine" and added the class with the following code in this folder `<?php use Doctrine\Persistence\ObjectManager; class RefreshTokenManager extends BaseRefreshTokenManager
} |
@johnnydi clear the cache should fix that, otherwise remove the contents of the cache folder. |
Solved in v0.10.0, please confirm that! |
Hello @markitosgv |
I can also confirm the issue has been fixed, thanks @markitosgv! I believe this issue could be closed |
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
becameDoctrine\Persistence\ObjectManager
.The text was updated successfully, but these errors were encountered: