Having an issue with my Vue application where the axios intercept is not applying the authorization token as expected.
axios.interceptors.request.use(config => {
let token = localStorage.getItem("jwt_token")
console.log("Token is: ", token)
console.log(typeof token)
if (token) {
axios.defaults.headers.Authorization = `Bearer ${token}`
}
console.log(config)
return config
});
After logging the Token before setting it to the Auth header, I noticed an issue in my console log output.