Pull info from node env var, not package.json
This commit is contained in:
parent
3447c80a6a
commit
66f587a5f9
@ -1,38 +1,37 @@
|
||||
import dicomParser from 'dicom-parser';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
import OHIF from 'ohif-core';
|
||||
import version from './version.js';
|
||||
import { homepage } from '../package.json';
|
||||
import dicomParser from 'dicom-parser'
|
||||
import cornerstone from 'cornerstone-core'
|
||||
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
|
||||
import OHIF from 'ohif-core'
|
||||
import version from './version.js'
|
||||
|
||||
window.info = {
|
||||
version,
|
||||
homepage
|
||||
};
|
||||
homepage: `${process.env.PUBLIC_URL}`,
|
||||
}
|
||||
|
||||
// For debugging
|
||||
window.cornerstone = cornerstone;
|
||||
window.cornerstoneWADOImageLoader = cornerstoneWADOImageLoader;
|
||||
window.cornerstone = cornerstone
|
||||
window.cornerstoneWADOImageLoader = cornerstoneWADOImageLoader
|
||||
|
||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
|
||||
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
|
||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
|
||||
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
|
||||
|
||||
OHIF.user.getAccessToken = () => {
|
||||
// TODO: Get the Redux store from somewhere else
|
||||
const state = window.store.getState();
|
||||
const state = window.store.getState()
|
||||
if (!state.oidc || !state.oidc.user) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
return state.oidc.user.access_token;
|
||||
};
|
||||
return state.oidc.user.access_token
|
||||
}
|
||||
|
||||
cornerstoneWADOImageLoader.configure({
|
||||
beforeSend: function(xhr) {
|
||||
const headers = OHIF.DICOMWeb.getAuthorizationHeader();
|
||||
const headers = OHIF.DICOMWeb.getAuthorizationHeader()
|
||||
|
||||
if (headers.Authorization) {
|
||||
xhr.setRequestHeader('Authorization', headers.Authorization);
|
||||
xhr.setRequestHeader('Authorization', headers.Authorization)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user