JWTRefreshTokenBundle
JWTRefreshTokenBundle copied to clipboard
Event before RefreshToken is persisted
Hi all,
I think it can be usefull to have an Event dispatched before the RefreshToke is persisted to add some data inthe Entity. My current usecase is that I want to store the userAgent of the user's device when s/he connnect for the first time. Currently I do that listening to lexik_jwt_authentication.on_authentication_success adding my data and persisting again the RefreshToken. But that makes 2 DB operations where only one is necessary.
Having an event in the Gesdinet\JWTRefreshTokenBundle\Doctrine\RefreshTokenManager::save
or AttachRefreshTokenOnSuccessListener::attachRefreshToken
should allow to add some data to the Entity before persist.
Regards
I will create a pull request for this. I've implemented this.
Use case: When you have a multiple authenticators (like one for your web-app and one for your mobile-app) and you want to store the type.
why is the pull request closed