[Bug] Fix unable to set unsafe-headers
This commit is contained in:
parent
c080f6c429
commit
7a2fb8eef1
1 changed files with 14 additions and 1 deletions
|
@ -18,7 +18,20 @@ export default axios => {
|
||||||
wootApi.defaults.baseURL = constants.apiURL;
|
wootApi.defaults.baseURL = constants.apiURL;
|
||||||
// Add Auth Headers to requests if logged in
|
// Add Auth Headers to requests if logged in
|
||||||
if (Auth.isLoggedIn()) {
|
if (Auth.isLoggedIn()) {
|
||||||
Object.assign(wootApi.defaults.headers.common, Auth.getAuthData());
|
const {
|
||||||
|
'access-token': accessToken,
|
||||||
|
'token-type': tokenType,
|
||||||
|
client,
|
||||||
|
expiry,
|
||||||
|
uid,
|
||||||
|
} = Auth.getAuthData();
|
||||||
|
Object.assign(wootApi.defaults.headers.common, {
|
||||||
|
'access-token': accessToken,
|
||||||
|
'token-type': tokenType,
|
||||||
|
client,
|
||||||
|
expiry,
|
||||||
|
uid,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Response parsing interceptor
|
// Response parsing interceptor
|
||||||
wootApi.interceptors.response.use(
|
wootApi.interceptors.response.use(
|
||||||
|
|
Loading…
Reference in a new issue