1👍
If you authorising user to use api you have to have a token either in url or in authorisation header key. That token should be from api_token
column in users
table.
var token = 'exampleToken';
axios.get(
'/api/user?api_token=' + token, // here
{
headers:
{
'Authorization':'Bearer ' + token // or here
}
}
).then(...)
-1👍
axios.get('/api/user',{headers:{
'Accept':'application/json',
'Authorization':'Bearer ' + window.localStorage.getItem('token_name_here')
'cache-control':'no-cache'
}).then(...)...
- [Vuejs]-Vue computed cannot get the the attributes in the object
- [Vuejs]-Vue.js dynamic array in template not working
Source:stackexchange.com