Merge branch 'main' of https://github.com/classroomio/classroomio into feat/release-v2
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user