feat: auto enroll into org as student and oauth improvements

This commit is contained in:
Rotimi Best
2026-05-20 08:32:56 +01:00
parent d21d89f250
commit 71fbb2101c
18 changed files with 482 additions and 21 deletions
@@ -1,6 +1,7 @@
import { BRAND_ROOT_DOMAIN, TENANT_ROOT_DOMAIN } from '@cio/utils/constants';
import { getVerifiedCustomDomainHostnames } from '../../queries/organization/organization';
const CLASSROOMIO_ROOT = 'classroomio.com';
const FIRST_PARTY_ROOTS: readonly string[] = [BRAND_ROOT_DOMAIN, TENANT_ROOT_DOMAIN];
/** Lowercase hostnames with verified custom domains ( warmed at API boot + updated on domain routes ). */
const verifiedCustomDomainHostnames = new Set<string>();
@@ -25,7 +26,7 @@ function originMatchesStaticEntry(origin: string, entry: string): boolean {
function isClassroomioHost(hostname: string): boolean {
const host = hostname.toLowerCase();
return host === CLASSROOMIO_ROOT || host.endsWith(`.${CLASSROOMIO_ROOT}`);
return FIRST_PARTY_ROOTS.some((root) => host === root || host.endsWith(`.${root}`));
}
export function trustCustomDomainHostname(hostname: string): void {