Search code examples
javascriptreactjsapiauthenticationtoken

Where should I pass the Bearer Authentication Token in a React project?


I got a Bearer Token and I don't know what to do with it. It's a React Project and I'm using Axios to get data from the API. My question is where does this Token go? Should I put it everytime I use Axios.get or I can store it somewhere?


Solution

  • You have to put in Authorization headers in every request. Refer to this answer Sending the bearer token with axios