Get supabase if undefined
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user