Exclude blockedSubdomain in check

This commit is contained in:
Rotimi Best
2023-07-02 15:56:15 +01:00
parent 1e71a91a54
commit f664a43e93
+8 -5
View File
@@ -42,6 +42,7 @@
import { toggleBodyByTheme } from '../utils/functions/app'; import { toggleBodyByTheme } from '../utils/functions/app';
import { appStore } from '../utils/store/app'; import { appStore } from '../utils/store/app';
import { currentOrg } from '../utils/store/org'; import { currentOrg } from '../utils/store/org';
import { blockedSubdomain } from '../utils/constants/app';
export let segment; export let segment;
export let config; export let config;
@@ -171,13 +172,15 @@
const debug = localStorage.getItem('role') === 'student'; const debug = localStorage.getItem('role') === 'student';
const matches = host.match(/([a-z0-9]+).*classroomio[.]com/); const matches = host.match(/([a-z0-9]+).*classroomio[.]com/);
const subdomain = matches?.[1] ?? ''; const subdomain = matches?.[1] ?? '';
const answer = Array.isArray(matches)
? !!subdomain && subdomain !== 'www'
: false;
$appStore.isStudentDomain = debug || answer; if (!blockedSubdomain.includes(subdomain)) {
$appStore.siteNameFromDomain = debug ? 'codingdojo' : subdomain; const answer = Array.isArray(matches)
? !!subdomain && subdomain !== 'www'
: false;
$appStore.isStudentDomain = debug || answer;
$appStore.siteNameFromDomain = debug ? 'codingdojo' : subdomain;
}
skipAuth = debug || subdomain === 'play'; skipAuth = debug || subdomain === 'play';
} }
} }