V
V
ValeraNakhuy2020-03-23 16:46:38
JavaScript
ValeraNakhuy, 2020-03-23 16:46:38

How to renew access token on any request using refresh token?

In general, such a task arose, but I am not strong in backing, so I ask for help.

So I have both tokens stored on the client, I return them when I log in, and I put them in the store.
I send each request to the header access token
. I store the refresh token in the database.

I end up sending a request, reading access, then creating a new access.
1. Why is there a refresh in this scheme? If you can just send a new access
2. How to send a new access in a normal request? Should I put it in req.header and change it on the client for every request?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question