From 0391fa0afc4cf8557d88af6f9a5ffe3bdba2091a Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Wed, 21 Feb 2024 21:06:46 +0530 Subject: [PATCH] revert: add new api for send a refresh-token (#1216) (#1232) --- src/client.ts | 15 --------------- src/connection.ts | 6 ------ src/events.ts | 2 -- 3 files changed, 23 deletions(-) diff --git a/src/client.ts b/src/client.ts index 2695df347..d9c0c5885 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1237,10 +1237,6 @@ export class StreamChat(this.baseURL + `/messages/${id}/commit`); } - - /** - * Calls the token provider to retrieve a new token - * - * This is an internal method, you only need to use it if, for some reason, the existing refresh logic of the client doesn't suit your needs. - * - */ - async refreshToken() { - const token = await this.tokenManager.loadToken(); - return this.wsConnection?.refreshToken(token); - } } diff --git a/src/connection.ts b/src/connection.ts index 1c1fc0618..d567bdb56 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -622,10 +622,4 @@ export class StableWSConnection { - // you can expect `token.ack` event if backend registered the new token for the WS connection - const d = JSON.stringify({ type: 'token.refresh', api_key: this.client.key, token }); - this.ws?.send(d); - }; } diff --git a/src/events.ts b/src/events.ts index 9c91967ab..a895adb63 100644 --- a/src/events.ts +++ b/src/events.ts @@ -42,8 +42,6 @@ export const EVENT_MAP = { 'user.updated': true, 'user.watching.start': true, 'user.watching.stop': true, - 'token.expiring': true, - 'token.ack': true, // local events 'channels.queried': true,