diff --git a/pairent_frontend_react/src/API/User.js b/pairent_frontend_react/src/API/User.js index 1bed60c..4fc42c4 100644 --- a/pairent_frontend_react/src/API/User.js +++ b/pairent_frontend_react/src/API/User.js @@ -40,15 +40,15 @@ class IAPIObject { /** @returns {ThisType} */ static restoreFromLocalStorage() { _checkStorageSupport(); - if (!window.localStorage.getItem(this.storage_key)) + if (!window.sessionStorage.getItem(this.storage_key)) return false; - return new APIToken(window.localStorage.getItem(this.storage_key)); + return new APIToken(window.sessionStorage.getItem(this.storage_key)); } /** @returns {boolean} */ static isCached() { this._checkStorageSupport(); - if (window.localStorage.getItem(this.storage_key)) { + if (window.sessionStorage.getItem(this.storage_key)) { return true; } return false; @@ -62,7 +62,7 @@ class IAPIObject { saveToLocalStorage() { this._IcheckStorageSupport(); - window.localStorage.setItem(this._getStorageKey(), JSON.stringify(this)); + window.sessionStorage.setItem(this._getStorageKey(), JSON.stringify(this)); } }