From 07b34eb44d83cb932706fb344972f0af131b7a86 Mon Sep 17 00:00:00 2001 From: Richard C Lim <61879224+richardclim@users.noreply.github.com> Date: Mon, 3 Feb 2025 03:36:38 -0500 Subject: [PATCH] Update common.ts --- app/api/common.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/common.ts b/app/api/common.ts index c250b5cb4..f7441f90a 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -14,8 +14,12 @@ const isAzure = req.nextUrl.pathname.includes("azure/deployments") || Boolean(se var authValue, authHeaderName = ""; if (isAzure) { - authValue = `Bearer ${serverConfig.azureApiKey}`; - authHeaderName = "Authorization"; + authValue = `Bearer ${req.headers + .get("Authorization") + ?.trim() + .replaceAll("Bearer ", "") + .trim() ?? ""}`; + authHeaderName = "Authorization"; } else { authValue = req.headers.get("Authorization") ?? ""; authHeaderName = "Authorization";