feat: support custom domain (#462)
* feat: add custom domain CRUD * chore: fetch organization in layout in server before render * debugging * update log
This commit is contained in:
@@ -70,11 +70,19 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
const isDev = dev || isLocalHost;
|
||||
|
||||
if (!url.host.includes('.classroomio.com') && !isLocalHost) {
|
||||
// TODO: We can verify if custom domain here
|
||||
return response;
|
||||
}
|
||||
// Custom domain
|
||||
response.org = (await getCurrentOrg(url.host, true, true)) || null;
|
||||
|
||||
if (!blockedSubdomain.includes(subdomain)) {
|
||||
console.log('custom domain response.org', response.org);
|
||||
|
||||
if (!response.org) {
|
||||
throw redirect(307, 'https://app.classroomio.com/404?type=org');
|
||||
}
|
||||
|
||||
response.isOrgSite = true;
|
||||
response.orgSiteName = response.org?.siteName || '';
|
||||
return response;
|
||||
} else if (!blockedSubdomain.includes(subdomain)) {
|
||||
const answer = !!subdomain;
|
||||
|
||||
response.isOrgSite = debugMode || answer;
|
||||
|
||||
Reference in New Issue
Block a user