From 5780a9635c29de43aee8637bf605f7bfd199e2d1 Mon Sep 17 00:00:00 2001 From: souvik Date: Tue, 12 Dec 2023 08:12:51 +0530 Subject: [PATCH] feat: constructing url in auth --- src/adapters/ws/client.ts | 5 ----- src/lib/wsHttpAuth.ts | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/adapters/ws/client.ts b/src/adapters/ws/client.ts index efea28939..7f2bf0cf0 100644 --- a/src/adapters/ws/client.ts +++ b/src/adapters/ws/client.ts @@ -51,11 +51,6 @@ class WsClientAdapter extends Adapter { const modedAuth = await gleeAuth.processClientAuth({ url, headers, query: {} }) headers = modedAuth.headers url = modedAuth.url - if (modedAuth.query) { - Object.keys(modedAuth.query).forEach(k => { - url.searchParams.set(k, modedAuth.query[k]) - }) - } } this.clients.push({ channel: channelName, diff --git a/src/lib/wsHttpAuth.ts b/src/lib/wsHttpAuth.ts index b0836d99c..851151c70 100644 --- a/src/lib/wsHttpAuth.ts +++ b/src/lib/wsHttpAuth.ts @@ -77,7 +77,11 @@ class GleeAuth extends EventEmitter { const conf = this.httpApiKeyLogic(scheme, headers, query, authKey) headers = conf.headers query = conf.query - + if (query) { + Object.keys(query).forEach(k => { + url.searchParams.set(k, query[k]) + }) + } } }) return { url, headers, query }