fetchData () {
axios.get('https://some-address.com/orders', {
params: {
limit: this.limit,
offset: this.offset
},
headers: auth.getAuthHeader()
})
.then((resp) => {
this.req = resp.data
console.log(resp)
})
.catch((err) => {
console.log(err)
})
}
Storing token in "auth/index.js"
// The object to be passed as a header for authenticated requests
getAuthHeader () {
return {
'Authorization': localStorage.getItem('access_token')
}
}
When i send GET request to receive a list of items, i'm getting the following headers in response:
in request:
Status code 403, obviously API is not getting my access_token
. But if i make the same request in Postman (manually pasting access token value) - it works.
Error from console: