From 893dc5d470a37e1d2ecd97a22b77723160f4eb70 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Tue, 19 Nov 2024 15:49:23 -0500 Subject: [PATCH] fix: plumb through api playground authorization --- packages/ui/app/src/playground/utils/auth-headers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui/app/src/playground/utils/auth-headers.ts b/packages/ui/app/src/playground/utils/auth-headers.ts index 077fb88624..710c928cc1 100644 --- a/packages/ui/app/src/playground/utils/auth-headers.ts +++ b/packages/ui/app/src/playground/utils/auth-headers.ts @@ -80,9 +80,11 @@ export function buildAuthHeaders( } catch {} } - const tokenPrefix = authState.oauth?.tokenPrefix || "Bearer"; + const tokenPrefix = oAuthClientCredentials.value.tokenPrefix ?? "Bearer"; - headers["Authorization"] = + headers[ + pascalCaseHeaderKey(oAuthClientCredentials.value.headerName || "Authorization") + ] = `${tokenPrefix.length ? `${tokenPrefix} ` : ""}${redacted ? obfuscateSecret(token) : token}`; }, });