mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
Enable CORS on the frontend
This commit is contained in:
parent
5e7f7983e1
commit
fa97470e21
@ -15,15 +15,11 @@ let headers = {
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (window.DEBUG) {
|
|
||||||
headers.Authorization = 'Basic ' + window.CREDENTIALS;
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch.defaults({
|
fetch.defaults({
|
||||||
urlMap: ApiUrls,
|
urlMap: ApiUrls,
|
||||||
http: {
|
http: {
|
||||||
headers: headers,
|
headers: headers,
|
||||||
credentials: 'same-origin'
|
credentials: 'cors'
|
||||||
},
|
},
|
||||||
fatalErrorHandler: (err) => {
|
fatalErrorHandler: (err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -7,7 +7,7 @@ let constants = {
|
|||||||
// super pro. What if we render stuff on the server?
|
// super pro. What if we render stuff on the server?
|
||||||
//'baseUrl': window.BASE_URL,
|
//'baseUrl': window.BASE_URL,
|
||||||
'apiEndpoint': window.API_ENDPOINT,
|
'apiEndpoint': window.API_ENDPOINT,
|
||||||
'baseUrl': 'http://staging.ascribe.io/api/',
|
'baseUrl': window.BASE_URL,
|
||||||
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000
|
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000
|
||||||
'aclList': ['edit', 'consign', 'consign_request', 'unconsign', 'unconsign_request', 'transfer',
|
'aclList': ['edit', 'consign', 'consign_request', 'unconsign', 'unconsign_request', 'transfer',
|
||||||
'loan', 'loan_request', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']
|
'loan', 'loan_request', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']
|
||||||
|
Loading…
Reference in New Issue
Block a user