Skip to content

Commit

Permalink
Merge pull request #28 from glific/remove-authorization
Browse files Browse the repository at this point in the history
Remove authorization header from floweditor
  • Loading branch information
mdshamoon authored Apr 13, 2021
2 parents 35688c2 + c0bf0c6 commit 1626854
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,11 @@ import ReactDOM from 'react-dom';

import * as serviceWorker from './serviceWorker';
import { setHTTPTimeout } from 'external';
import axios from 'axios';
import { getAuthToken } from 'utils';

const axiosInterceptor = axios.interceptors.request.use(
function(config) {
config.headers.Authorization = getAuthToken();
return config;
},
function(error) {
console.log(error);
return Promise.reject(error);
}
);

// bring in our temba-components if they aren't already registered
if (typeof customElements !== 'undefined' && !customElements.get('temba-textinput')) {
import('@nyaruka/temba-components').then(() => {
console.log('Loading temba components');

const origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
origOpen.apply(this, arguments);
this.setRequestHeader('Authorization', getAuthToken());
};
axios.interceptors.request.eject(axiosInterceptor);
});
}

Expand Down

0 comments on commit 1626854

Please sign in to comment.