Open christoph-kluge opened 4 years ago
Is there any need for someone to have this? Since it's a singleton I'm setting the key with $container->afterResolving()
. I'm up to contribute if this is little extension is wanted.
// somewhere inside a provider
$this->app->afterResolving(Blacklist::class, function (Blacklist $blacklist) {
$blacklist->setKey(config('jwt.blacklist_key', 'jti'));
});
// extend jwt.php
/*
|--------------------------------------------------------------------------
| Blacklist Key
|--------------------------------------------------------------------------
|
| In order to invalidate tokens, you must choose a identifer inside the payload.
| If you want to invalidate just a single token then you can keep 'jti' as default.
| You may want to change this to some different behavior/invalidation algorithm.
|
*/
'blacklist_key' => env('JWT_BLACKLIST_KEY', 'jti'),
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Subject of the issue
In my scenario I need to use a different blacklist key which is unique across multiple generated JWT tokens but it cannot be the user id (because as user can login 1:n times).
I've discovered the following piece of code which could be easily extended with
setKey
.Your environment