Revert "Merge branch 'fix_null_bearer' into 'develop'"

This reverts commit 22c3fa995d, reversing
changes made to 3931ba4f81.
This commit is contained in:
Fosco Marotto 2021-02-09 23:57:16 -05:00
parent c14fc2fa9d
commit ad35c7fa72
1 changed files with 12 additions and 16 deletions

View File

@ -25,20 +25,16 @@ function setCSRFHeader() {
ready(setCSRFHeader);
export default getState => {
const authToken = getState ? getState().getIn(['meta', 'access_token'], '') : null;
export default getState => axios.create({
headers: Object.assign(csrfHeader, getState ? {
'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`,
} : {}),
return axios.create({
headers: Object.assign(csrfHeader, authToken ? {
'Authorization': `Bearer ${authToken}}`,
} : {}),
transformResponse: [function (data) {
try {
return JSON.parse(data);
} catch (Exception) {
return data;
}
}],
});
};
transformResponse: [function (data) {
try {
return JSON.parse(data);
} catch (Exception) {
return data;
}
}],
});