Merge branch 'main' of https://github.com/classroomio/classroomio into feat/release-v2

This commit is contained in:
Rotimi Best
2025-11-08 20:22:53 +01:00
9 changed files with 84 additions and 74 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);
@@ -11,6 +11,13 @@ export const getSupabase = () => {
return supabase;
};
export const hasSession = async () => {
const { data } = await getSupabase().auth.getSession();
console.log('has session', data);
return data.session !== null;
};
export const isSupabaseTokenInLocalStorage = () => {
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);