Answer the question
In order to leave comments, you need to log in
How to work with JWT correctly?
Usually, after the user has logged in, the received token is written to cookies / localstorage and on further requests the token is pulled from there, the duration of its action (expired) is checked and if everything is OK, then it is written to the request headers.
And how is the following scenario implemented, when there is some kind of conditional admin who can take and log out the user with his own command (early end the validity period of his jwt token). How to track this at the front, given that the token with a valid expiration time will still hang in the storage?
Answer the question
In order to leave comments, you need to log in
websockets, the front subscribes and checks the event.
BU throws an event - log out, FU accepts a command, performs an action (am I the dude with that ID that came over), cleans the local store.
or on some action of the user BU just throws - 401
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question