Revert "Merge branch 'features/null_bearer2' into 'develop'"
This reverts commitc14fc2fa9d
, reversing changes made to22c3fa995d
.
This commit is contained in:
parent
ad35c7fa72
commit
a1a97bb483
|
@ -40,13 +40,12 @@ const notify = options =>
|
||||||
const fetchFromApi = (path, method, accessToken) => {
|
const fetchFromApi = (path, method, accessToken) => {
|
||||||
const url = (new URL(path, self.location)).href;
|
const url = (new URL(path, self.location)).href;
|
||||||
|
|
||||||
let headers = {
|
return fetch(url, {
|
||||||
|
headers: {
|
||||||
'Authorization': `Bearer ${accessToken}`,
|
'Authorization': `Bearer ${accessToken}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
}
|
},
|
||||||
if (!accessToken) { delete headers['Authorization'] }
|
|
||||||
return fetch(url, {
|
|
||||||
headers: headers,
|
|
||||||
method: method,
|
method: method,
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
Loading…
Reference in New Issue