From e74d9a73127f03a8879ea5ebb36929ca36b73163 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sun, 25 Jul 2021 13:29:27 +0100 Subject: [PATCH] Reload location on client logout for full reset, avoiding error when public pages exist --- packages/client/src/store/auth.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/client/src/store/auth.js b/packages/client/src/store/auth.js index 86e4500282..beaeb6007c 100644 --- a/packages/client/src/store/auth.js +++ b/packages/client/src/store/auth.js @@ -1,20 +1,9 @@ import * as API from "../api" import { writable } from "svelte/store" -import { initialise } from "./initialise" -import { routeStore } from "./routes" const createAuthStore = () => { const store = writable(null) - const goToDefaultRoute = () => { - // Setting the active route forces an update of the active screen ID, - // even if we're on the same URL - routeStore.actions.setActiveRoute("/") - - // Navigating updates the URL to reflect this route - routeStore.actions.navigate("/") - } - // Fetches the user object if someone is logged in and has reloaded the page const fetchUser = async () => { const user = await API.fetchSelf() @@ -22,10 +11,8 @@ const createAuthStore = () => { } const logOut = async () => { - store.set(null) window.document.cookie = `budibase:auth=; budibase:currentapp=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;` - await initialise() - goToDefaultRoute() + window.location.reload() } return {