From f664a43e93b6b85ea180d8a07bdd8815f88db72d Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sun, 2 Jul 2023 15:56:15 +0100 Subject: [PATCH] Exclude blockedSubdomain in check --- src/routes/_layout.svelte | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte index 150947c0..38bdcda3 100644 --- a/src/routes/_layout.svelte +++ b/src/routes/_layout.svelte @@ -42,6 +42,7 @@ import { toggleBodyByTheme } from '../utils/functions/app'; import { appStore } from '../utils/store/app'; import { currentOrg } from '../utils/store/org'; + import { blockedSubdomain } from '../utils/constants/app'; export let segment; export let config; @@ -171,13 +172,15 @@ const debug = localStorage.getItem('role') === 'student'; const matches = host.match(/([a-z0-9]+).*classroomio[.]com/); const subdomain = matches?.[1] ?? ''; - const answer = Array.isArray(matches) - ? !!subdomain && subdomain !== 'www' - : false; - $appStore.isStudentDomain = debug || answer; - $appStore.siteNameFromDomain = debug ? 'codingdojo' : subdomain; + if (!blockedSubdomain.includes(subdomain)) { + const answer = Array.isArray(matches) + ? !!subdomain && subdomain !== 'www' + : false; + $appStore.isStudentDomain = debug || answer; + $appStore.siteNameFromDomain = debug ? 'codingdojo' : subdomain; + } skipAuth = debug || subdomain === 'play'; } }