-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Description
I use the following code it works until I reload the site. After reloading it doesn't call the interceptor anymore. What the problem? The token is still there in the session store. After relogin it starts working again until reload. Tested in Safari and Chrome. Using custom auth provider.
/**
* This is example for request and response interceptors for axios library
*/
Vue.use(VueAuthenticate, {
bindRequestInterceptor: function () {
this.$http.interceptors.request.use((config) => {
if (this.isAuthenticated()) {
config.headers['Authorization'] = [
this.options.tokenType, this.getToken()
].join(' ')
} else {
delete config.headers['Authorization']
}
return config
})
},
bindResponseInterceptor: function () {
this.$http.interceptors.response.use((response) => {
this.setToken(response)
return response
})
}
})
Metadata
Metadata
Assignees
Labels
No labels