Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sos99's avatar
Level 7

Laravel with Tymon JWT

When using Tymon JWT

  1. How work invalidate function with true and where is stored the Blacklist ?

  2. How can I block old tokens but still active session (force to logout) but some of the new token to keep be active as usual? (to the same user!!) ?

https://github.com/tymondesigns/jwt-auth https://jwt-auth.readthedocs.io/en/develop/auth-guard/#invalidate

0 likes
6 replies
sos99's avatar
Level 7

just where the blacklist are store ?

martinbean's avatar

@sos99 You don’t. JWTs are meant to have short lifetimes for this very reason. Because JWTs carry all the information in themselves, they can’t be “revoked” once issued like say, an OAuth token can be.

sos99's avatar
Level 7

@martinbean Thnak you for answering

according to JWT docs:

//Invalidate the token (add it to the blacklist)
// Pass true as the first param to force the token to be blacklisted "forever".
auth()->invalidate(true);

so how its work?

martinbean's avatar

@sos99 That’s a method provided by that package. So just call that method if it does what you want?

gssj85's avatar

I'm looking for this info also, apparently is stored in cache, how exactly it works we have to find out apparently...

hangouh's avatar

Hi, how are you?

I noticed that by default it seems to store data in Redis database 1.

This is how I select the database:

SELECT 1

And this is how I can see the list of keys:

KEYS *

That way, I was able to see where the data was being stored.

Please or to participate in this conversation.