diff --git a/apps/dashboard/src/lib/components/Buttons/Logout/index.svelte b/apps/dashboard/src/lib/components/Buttons/Logout/index.svelte index 2d240d1f..497671bc 100644 --- a/apps/dashboard/src/lib/components/Buttons/Logout/index.svelte +++ b/apps/dashboard/src/lib/components/Buttons/Logout/index.svelte @@ -5,11 +5,26 @@ import { VARIANTS } from '$lib/components/PrimaryButton/constants'; import { supabase } from '$lib/utils/functions/supabase'; import { capturePosthogEvent } from '$lib/utils/services/posthog'; + import { currentOrg, orgs } from '$lib/utils/store/org'; async function logout() { const { error } = await supabase.auth.signOut(); console.error('Error logging out: ', error); + // Reset organization values, TODO: consider abstracting if needed in other places + currentOrg.set({ + id: '', + name: '', + shortName: '', + siteName: '', + avatar_url: '', + memberId: '', + role_id: '', + landingpage: {}, + theme: '' + }) + orgs.set([]); + capturePosthogEvent('user_logged_out'); posthog.reset(); goto('/login');