diff --git a/core/src/utils/xhr-request.js b/core/src/utils/xhr-request.js index 68641ebc0069d..baed0dc78e9f3 100644 --- a/core/src/utils/xhr-request.js +++ b/core/src/utils/xhr-request.js @@ -33,7 +33,7 @@ const isNextcloudUrl = (url) => { * @returns {Promise} */ async function checkLoginStatus() { - // skip if no logged in user + // skip if no logged-in user if (getCurrentUser() === null) { return } @@ -51,6 +51,13 @@ async function checkLoginStatus() { const { status } = await window.fetch(generateUrl('/apps/files')) if (status === 401) { console.warn('User session was terminated, forwarding to login page.') + // Clear all storages and redirect to login page + window.localStorage.clear() + window.sessionStorage.clear() + const indexedDBList = await window.indexedDB.databases() + for (const indexedDB of indexedDBList) { + await window.indexedDB.deleteDatabase(indexedDB.name) + } window.location = generateUrl('/login?redirect_url={url}', { url: window.location.pathname + window.location.search + window.location.hash, })