J
J
jslint2018-11-24 02:23:40
React
jslint, 2018-11-24 02:23:40

How to make authorization with a token?

There is an API that returns a token.
This token must be substituted in all requests.
If the request returned a token error, you need to redirect to the authorization page and get the token again.
Plz tell me how to do this easily?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Filippov, 2018-11-24
@jslint

make an axios instance where you will put tokens from cookies
With the help of hands and a little head

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question