diff --git a/apps/dashboard/src/routes/+layout.server.ts b/apps/dashboard/src/routes/+layout.server.ts index 6884e4f6..ba619d33 100644 --- a/apps/dashboard/src/routes/+layout.server.ts +++ b/apps/dashboard/src/routes/+layout.server.ts @@ -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 => { 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; } diff --git a/apps/dashboard/src/routes/404/+page.svelte b/apps/dashboard/src/routes/404/+page.svelte index 1ff5a9e9..56a4709b 100644 --- a/apps/dashboard/src/routes/404/+page.svelte +++ b/apps/dashboard/src/routes/404/+page.svelte @@ -1,10 +1,13 @@

- Oops😕,where did the page go? + {#if isOrg} + Oops😕, this organization doesn't exist! + {:else} + Oops😕,where did the page go? + {/if}

- We're sorry, but something went wrong and we can't show you the page - you're looking for. In the meantime, here's a joke to make you laugh:
+ We're sorry, but something went wrong and we can't show you the page you're looking for. In + the meantime, here's a joke to make you laugh:
What do you call a fish with no eyes? Fsh!

- goto('/')} - /> + goto('/')} />
- classroomio_error_image + classroomio_error_image