Revert "Merge branch 'fix_null_bearer' into 'develop'"
This reverts commit22c3fa995d
, reversing changes made to3931ba4f81
.
This commit is contained in:
parent
c14fc2fa9d
commit
ad35c7fa72
|
@ -25,20 +25,16 @@ function setCSRFHeader() {
|
||||||
|
|
||||||
ready(setCSRFHeader);
|
ready(setCSRFHeader);
|
||||||
|
|
||||||
export default getState => {
|
export default getState => axios.create({
|
||||||
const authToken = getState ? getState().getIn(['meta', 'access_token'], '') : null;
|
headers: Object.assign(csrfHeader, getState ? {
|
||||||
|
'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`,
|
||||||
|
} : {}),
|
||||||
|
|
||||||
return axios.create({
|
transformResponse: [function (data) {
|
||||||
headers: Object.assign(csrfHeader, authToken ? {
|
try {
|
||||||
'Authorization': `Bearer ${authToken}}`,
|
return JSON.parse(data);
|
||||||
} : {}),
|
} catch (Exception) {
|
||||||
|
return data;
|
||||||
transformResponse: [function (data) {
|
}
|
||||||
try {
|
}],
|
||||||
return JSON.parse(data);
|
});
|
||||||
} catch (Exception) {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue