I'm trying to have a laravel passport authentication, generating access tokens and storing them to localStorage, I'm able to get the access token but while placing it into localStorage I'm unable to fetch the value, while doing so I'm implementing something like this:
axios.post('/oauth/token', postData).then(response => {
if(response.status === 200)
{
authUser.access_token = response.data.access_token;
authUser.refresh_token = response.data.refresh_token;
console.log(authUser);
window.localStorage.setItem('authUser', JSON.stringify(authUser))
console.log(window.localStorage.getItem('authUser'))
}
})
As I said I'm implementing in predefined laravel so the resources I'm using is defaults. Do I need to add anything more? like vue-resource