From 9210bbd4fc349491d5d3465279aee1dc97a021a3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Sep 2020 11:50:52 +0200 Subject: [PATCH] Clear localStorage settings on logout --- www/common/outer/local-store.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/common/outer/local-store.js b/www/common/outer/local-store.js index fbda718d4..774924148 100644 --- a/www/common/outer/local-store.js +++ b/www/common/outer/local-store.js @@ -109,6 +109,13 @@ define([ delete localStorage[k]; delete sessionStorage[k]; }); + try { + Object.keys(localStorage || {}).forEach(function (k) { + // Remvoe everything in localStorage except CACHE and FS_hash + if (/^CRYPTPAD_CACHE/.test(k) || /^LESS_CACHE/.test(k) || k === Constants.fileHashKey) { return; } + delete localStorage[k]; + }); + } catch (e) { console.error(e); } LocalStore.clearThumbnail(); // Make sure we have an FS_hash in localStorage before reloading all the tabs // so that we don't end up with tabs using different anon hashes