chore: move lms to myclassroomio.com and use approximated for custom
domain
This commit is contained in:
@@ -99,7 +99,7 @@ function isURLCustomDomain(url: URL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const notCustomDomainHosts = [env.PRIVATE_APP_HOST || '', 'classroomio.com', 'classroomio.school'].filter(Boolean);
|
||||
const notCustomDomainHosts = [env.PRIVATE_APP_HOST || '', 'classroomio.com', 'myclassroomio.com'].filter(Boolean);
|
||||
|
||||
return !notCustomDomainHosts.some((host) => url.host.endsWith(host));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { type ApiClientConfig, ApiError, type RequestConfig } from './types';
|
||||
|
||||
import { dev } from '$app/environment';
|
||||
import { DEFAULT_CONFIG } from './constants';
|
||||
import { delay } from './utils';
|
||||
import { hcWithType } from '@cio/api/rpc-types';
|
||||
@@ -19,7 +20,7 @@ export const getRequestBaseUrl = () => {
|
||||
// Self-hosted: dashboard and API are on different subdomains of the
|
||||
// operator's apex. Browser calls go straight to PUBLIC_SERVER_URL;
|
||||
// cookies cross subdomains via AUTH_COOKIE_DOMAIN. No Worker proxy.
|
||||
if (env.PUBLIC_IS_SELFHOSTED === 'true') {
|
||||
if (env.PUBLIC_IS_SELFHOSTED === 'true' || dev) {
|
||||
return env.PUBLIC_SERVER_URL ?? '';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createAuthClient } from 'better-auth/svelte';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { ssoClient } from '@better-auth/sso/client';
|
||||
import { dev } from '$app/environment';
|
||||
|
||||
// Browser baseURL depends on deployment shape:
|
||||
//
|
||||
@@ -22,7 +23,7 @@ function resolveBaseURL() {
|
||||
if (typeof window === 'undefined') {
|
||||
return env.PUBLIC_SERVER_URL || 'http://localhost:3002';
|
||||
}
|
||||
if (env.PUBLIC_IS_SELFHOSTED === 'true') {
|
||||
if (env.PUBLIC_IS_SELFHOSTED === 'true' || dev) {
|
||||
return env.PUBLIC_SERVER_URL || `${window.location.origin}/api/auth`;
|
||||
}
|
||||
return `${window.location.origin}/proxy/api/auth`;
|
||||
|
||||
Reference in New Issue
Block a user