feat: 404 for not found subdomain

This commit is contained in:
Rotimi Best
2023-12-11 03:27:13 +03:00
parent b7f9d145de
commit 820a59c80e
2 changed files with 17 additions and 15 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
// import { redirect } from '@sveltejs/kit';
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';
@@ -36,6 +36,10 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
response.isOrgSite = debugMode || answer;
response.orgSiteName = debugMode ? _orgSiteName : subdomain;
response.org = (await getCurrentOrg(response.orgSiteName, true)) || null;
if (!response.org) {
throw redirect(302, '/404?type=org');
}
} else if (subdomain === 'play' || debugPlay === 'true') {
response.skipAuth = true;
}