Skip to content

Commit

Permalink
Revert "fix: name change for cache"
Browse files Browse the repository at this point in the history
This reverts commit 255ece9.
  • Loading branch information
bogdan-niculescu-sch committed Apr 15, 2024
1 parent 008e1f9 commit 4a661b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/identity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4a661b7

Please sign in to comment.