From fa97470e21ff5fa2dcc9eec0a2888ed49e55584e Mon Sep 17 00:00:00 2001 From: vrde Date: Thu, 11 Jun 2015 17:07:27 +0200 Subject: [PATCH] Enable CORS on the frontend --- js/app.js | 6 +----- js/constants/application_constants.js | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 447ecc96..7b2b485e 100644 --- a/js/app.js +++ b/js/app.js @@ -15,15 +15,11 @@ let headers = { 'Content-Type': 'application/json' }; -if (window.DEBUG) { - headers.Authorization = 'Basic ' + window.CREDENTIALS; -} - fetch.defaults({ urlMap: ApiUrls, http: { headers: headers, - credentials: 'same-origin' + credentials: 'cors' }, fatalErrorHandler: (err) => { console.log(err); diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js index 508eebda..498a26f0 100644 --- a/js/constants/application_constants.js +++ b/js/constants/application_constants.js @@ -7,7 +7,7 @@ let constants = { // super pro. What if we render stuff on the server? //'baseUrl': window.BASE_URL, 'apiEndpoint': window.API_ENDPOINT, - 'baseUrl': 'http://staging.ascribe.io/api/', + 'baseUrl': window.BASE_URL, 'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000 'aclList': ['edit', 'consign', 'consign_request', 'unconsign', 'unconsign_request', 'transfer', 'loan', 'loan_request', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']