edit: patch XHR Request dengan coverage lebih luas dari monkeyPatchXML

This commit is contained in:
mario
2025-05-09 16:40:02 +07:00
parent 86ad0b38dd
commit 8d090fe19f
3 changed files with 25 additions and 7 deletions

View File

@@ -39,6 +39,15 @@ export default function initWADOImageLoader(
Accept: acceptHeader,
};
// // Patch Mario:
const authToken = sessionStorage.getItem('ohif-auth-token');
if (!authToken) {
window.location.href = '/login';
return;
}
xhrRequestHeaders.Authorization = `Bearer ${authToken}`;
if (headers) {
Object.assign(xhrRequestHeaders, headers);
}