I am using localStorage
to set and get items, which is placed within my javascript code in a .vue file. However, I would like to somehow access that storage and place it within my Vuex store section which is in another file, most preferably within the mutations.
If someone knows how to do this, please could you help? Below is the code of the localStorage that I am using.
if(response.status === 200){
console.log('TOKEN_SET', response)
this.access_token = response.data.access_token
localStorage.setItem(this.access_token, JSON.stringify(this.access_token));
};
mounted(){
console.log('GOT_TOKEN')
if(localStorage.getItem(this.access_token)) this.access_token = JSON.parse(localStorage.getItem(this.access_token))
}