From 0bb6d19e9288a902f9d6f63cad3333d432ee3e96 Mon Sep 17 00:00:00 2001 From: mario Date: Wed, 21 May 2025 16:40:15 +0700 Subject: [PATCH] add auth header to fetch expertise --- .../ui-next/src/components/SidePanel/SidePanel.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/ui-next/src/components/SidePanel/SidePanel.tsx b/platform/ui-next/src/components/SidePanel/SidePanel.tsx index ed1f7d2..6a67311 100644 --- a/platform/ui-next/src/components/SidePanel/SidePanel.tsx +++ b/platform/ui-next/src/components/SidePanel/SidePanel.tsx @@ -294,9 +294,20 @@ const SidePanel = ({ return; } + // Create request headers with Authorization if token exists + const authToken = window.sessionStorage.getItem('ohif-auth-token'); + + const headers: HeadersInit = {}; + if (authToken) { + headers['Authorization'] = `Bearer ${authToken}`; + } + // Fetch data with specific fields including Accession Number const response = await fetch( - `${qidoRootUrl}/studies?includefield=00080050&StudyInstanceUID=${studyInstanceUID}` + `${qidoRootUrl}/studies?includefield=00080050&StudyInstanceUID=${studyInstanceUID}`, + { + headers, + } ); if (!response.ok) {