Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function registerInterceptor(next = null) {
nprogress.configure({ showSpinner: false });
const authService = container.get(cid.IAuthService);
fetchIntercept.register({
request: function (url, config) {
nprogress.start();
config = config || {};
const headers = config.headers || {};
config.headers = {
...headers,
'Content-Type': 'application/json',
'x-api-version': '2.0',
Authorization: `Bearer ${authService.user.access_token}`
};
return [url, config];