From 4a661b7e7e90cc8096beed7a4e26399ca632e8ba Mon Sep 17 00:00:00 2001 From: niculescu-bogdan-constantin Date: Mon, 15 Apr 2024 13:39:31 +0200 Subject: [PATCH] Revert "fix: name change for cache" This reverts commit 255ece94c0133e8bdda6469e2bf4c0ff774b4c69. --- src/identity.d.ts | 3 +-- src/identity.js | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/identity.d.ts b/src/identity.d.ts index e75406c..49c10d7 100644 --- a/src/identity.d.ts +++ b/src/identity.d.ts @@ -28,8 +28,7 @@ export class Identity extends TinyEmitter { _sessionInitiatedSent: boolean; window: any; clientId: string; - sessionStorageCache: any; - localStorageCache: any; + cache: any; redirectUri: string; env: string; log: Function; diff --git a/src/identity.js b/src/identity.js index 32f20d2..ddfce1b 100644 --- a/src/identity.js +++ b/src/identity.js @@ -218,9 +218,9 @@ export class Identity extends EventEmitter { */ _getTabId() { if (this._enableSessionCaching) { - const tabId = this.sessionStorageCache.get(TAB_ID_KEY); + const tabId = this.cache.get(TAB_ID_KEY); if (!tabId) { - this.sessionStorageCache.set(TAB_ID_KEY, TAB_ID, TAB_ID_TTL); + this.cache.set(TAB_ID_KEY, TAB_ID, TAB_ID_TTL); return TAB_ID; } @@ -594,7 +594,7 @@ export class Identity extends EventEmitter { } let sessionData = null; try { - sessionData = await this._sessionService.get('/v2/session', {tabId: this._getTabId()}); + sessionData = await this._sessionService.get('/v2/session'); } catch (err) { if (err && err.code === 400 && this._enableSessionCaching) { const expiresIn = 1000 * (err.expiresIn || 300);