Get supabase if undefined

This commit is contained in:
Rotimi Best
2023-08-21 10:10:11 +01:00
parent 01cd003f7a
commit 2b36d0af67
+6
View File
@@ -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;