// Add a request interceptor
axios.interceptors.request.use(function (config) {
const token = store.getState().session.token;
config.headers.Authorization = token;
return config;
});
References:
https://stackoverflow.com/questions/43051291/attach-authorization-header-for-all-axios-requests?rq=1
axios.interceptors.request.use(function (config) {
const token = store.getState().session.token;
config.headers.Authorization = token;
return config;
});
References:
https://stackoverflow.com/questions/43051291/attach-authorization-header-for-all-axios-requests?rq=1
No comments:
Post a Comment