Laravel jwt do API logout login (logout) how to do? How to invalidate token

how should laravel jwt do API logout login (logout)? How to disable token?
Baidu has looked around without..

Mar.09,2021

it is estimated that there is some misunderstanding if you didn't read the document carefully. Let's talk about my understanding:
jwt itself is designed for api. In the case of separation of front and rear ends, exiting is just a front-end thing, and you can directly remove the token stored locally.
token itself is time-limited (2 hours by default) and cannot be used after it has expired (it will be added to blacklist in a short period of time), so don't worry, it doesn't eliminate token (invalidate token).


clears the token and then becomes invalid. You said that someone else took my token. This is a browser leaking problem, and this kind of problem is unsolvable (normally it doesn't happen)


I searched this problem before, and later found that I didn't seem to quit the function.

Menu