How can i access to store from a plugin?
[issue link]I’m using axios. It needs the Authorization header with bearer token on every request. The token is in the store.
import axios from 'axios'
let instance = axios.create({
baseURL: 'http://api.docstore.dev'
})
instance.interceptors.request.use(config => {
// How can i access this store instance below
config.headers['Authorization'] = 'Bearer ' + store.state.accessToken
return config
})
export default instance
Thank you!