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);