feat: centralize baseURL and app experience for cloud and self hosted

This commit is contained in:
Rotimi Best
2026-03-11 11:21:41 +01:00
parent a98d6a35fa
commit 74c87fb72a
18 changed files with 81 additions and 100 deletions
@@ -104,10 +104,11 @@ function isURLCustomDomain(url: URL) {
}
export function getSubdomain(url: URL) {
const appHost = env.PRIVATE_APP_HOST;
if (!appHost) return null;
const host = url.hostname.replace('www.', '');
const parts = host.split('.');
const appHost = env.PRIVATE_APP_HOST;
const appHostParts = appHost.split('.');
const isAppHost = parts.slice(-appHostParts.length).join('.') === appHost;