From f1de4eb358aa65ab252497159695d011536d8f02 Mon Sep 17 00:00:00 2001 From: Karel Hala Date: Mon, 4 Sep 2023 16:59:25 +0200 Subject: [PATCH] Add check not to append Auth header if already present --- src/utils/iqeEnablement.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/iqeEnablement.ts b/src/utils/iqeEnablement.ts index 7bc852009..f8d4adf27 100644 --- a/src/utils/iqeEnablement.ts +++ b/src/utils/iqeEnablement.ts @@ -107,7 +107,7 @@ function init(store: Store, libJwt?: () => LibJWT | undefined) { const tid = Math.random().toString(36); const request: Request = new Request(input, init); - if (checkOrigin(input) && libJwt?.()?.jwt.isAuthenticated()) { + if (checkOrigin(input) && libJwt?.()?.jwt.isAuthenticated() && !request.headers.has('Authorization')) { request.headers.append('Authorization', `Bearer ${libJwt?.()?.jwt.getEncodedToken()}`); }