fix: keep org store after logout

This fix tackled a bug where if I logged out, go to org landing page, open a course and enrol then it gets redirected to a 404 page because `$currentOrg.siteName` is undefined.
This commit is contained in:
Rotimi Best
2025-11-08 17:58:03 +01:00
parent 93db0c97e8
commit b783940cee
2 changed files with 6 additions and 33 deletions
@@ -1,7 +1,6 @@
import posthog from 'posthog-js';
import { supabase } from '$lib/utils/functions/supabase';
import { capturePosthogEvent } from '$lib/utils/services/posthog';
import { currentOrg, orgs, defaultCurrentOrgState } from '$lib/utils/store/org';
import { user, profile, defaultProfileState, defaultUserState } from '$lib/utils/store/user';
import { goto } from '$app/navigation';
@@ -12,8 +11,6 @@ export async function logout(redirect = true) {
console.error('Error logging out: ', error);
}
currentOrg.set(defaultCurrentOrgState);
orgs.set([]);
user.set(defaultUserState);
profile.set(defaultProfileState);