diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 46a338c4..0147333d 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -1,6 +1,11 @@ // import { redirect } from '@sveltejs/kit'; import { blockedSubdomain } from '$lib/utils/constants/app'; import { getCurrentOrg } from '$lib/utils/services/org'; +import { getSupabase, supabase } from '$lib/utils/functions/supabase'; + +if (!supabase) { + getSupabase(); +} /** @type {import('./$types').LayoutServerLoad} */ export const load = async ({ url, cookies }) => { @@ -28,6 +33,7 @@ export const load = async ({ url, cookies }) => { response.isOrgSite = debugMode || answer; response.orgSiteName = debugMode ? 'codingdojo' : subdomain; + response.org = await getCurrentOrg(response.orgSiteName, true); } else if (subdomain === 'play' || debugPlay === 'true') { response.skipAuth = true;