D
D
Danil2020-10-12 16:06:14
JSON Web Token
Danil, 2020-10-12 16:06:14

How to organize an access and refresh token?

Please help with JWT. How can I organize access and refresh token, as I understand it, when a user logs in, he needs to give him two tokens, but then it didn’t reach me, access token needs to be stored in cookies, and refresh in the database? And yet, when the user runs out of access token time, how can I organize the change of tokens? Should I send the user, for example, to url /refresh, and there already check the authenticity of the refresh token? But how can I get a refresh token from this url? Perhaps I misunderstood something. I would be grateful if you send an example of how to implement this on express js, well, or an explanation

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