Answer the question
In order to leave comments, you need to log in
How to update jwt token in vue js?
Hello! Can someone please explain how to update the jwt token? I created a route in laravel:
Route::get('/refresh-token', [
'uses' => '[email protected]',
'middleware' => 'auth.jwt'
]);
Answer the question
In order to leave comments, you need to log in
As an option, use two tokens, one access token, another refresh token. The first one has a short lifetime, the second one has a long one. When authenticating, you get both of these tokens on the client and save them in localStorage, for access you use the access token. Once it dies, catch it and get new tokens by making a /refresh-token request using a refresh token.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question