Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: clear localStorage on sign out

thecodrr3978d16715c5
diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js
index 8fc9faa7f..71594335d 100644
--- a/apps/web/src/stores/user-store.js
+++ b/apps/web/src/stores/user-store.js
@@ -3,6 +3,7 @@ import { db } from "../common";
import { store as appStore } from "./app-store";
import BaseStore from "./index";
import RootNavigator from "../navigation/navigators/rootnavigator";
+import config from "../utils/config";
class UserStore extends BaseStore {
isLoggedIn = false;
@@ -68,6 +69,7 @@ class UserStore extends BaseStore {
state.user = undefined;
state.isLoggedIn = false;
});
+ config.clear();
await appStore.refresh();
RootNavigator.navigate("home");
});
diff --git a/apps/web/src/utils/config.js b/apps/web/src/utils/config.js
index 8b3f92ee7..229a109e2 100644
--- a/apps/web/src/utils/config.js
+++ b/apps/web/src/utils/config.js
@@ -8,4 +8,8 @@ function get(key, def) {
return JSON.parse(value);
}
-export default { set, get };
+function clear() {
+ window.localStorage.clear();
+}
+
+export default { set, get, clear };