K
K
keyotor2021-08-30 20:17:00
JSON Web Token
keyotor, 2021-08-30 20:17:00

How to automatically renew access token jwt via refresh token?

Please tell me how to automatically update access token jwt through refresh token. I understand that there is a separate route for updating the access token, but there will be no button in the frontend: the access token has expired, click on the button to update. So how to automatically update?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
veryoriginalnickname, 2021-08-30
@keyotor

In Axios request interceptor, or in any other request interceptor, add a check for the term of the token, and if it has expired, then make a request for refresh, and after updating the token, continue executing the original request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question