I make web application with React, Express, MongoDB.
And, I want to pass jwt token with header.
But, I pass it, get 401 error (Unauthorized).
In login ac
Include your token as authorization key as below.
axios.post(url,data, { headers: { 'authorization': your_token, 'Accept' : 'application/json', 'Content-Type': 'application/json' } }) .then(response => { // return response; }) .catch((error) => { //return error; });