diff --git a/packages/features/ee/organizations/lib/orgDomains.ts b/packages/features/ee/organizations/lib/orgDomains.ts index 878455235ceb6b..461f5e2c03ff4d 100644 --- a/packages/features/ee/organizations/lib/orgDomains.ts +++ b/packages/features/ee/organizations/lib/orgDomains.ts @@ -100,7 +100,7 @@ export function subdomainSuffix() { } export function getOrgFullOrigin(slug: string, options: { protocol: boolean } = { protocol: true }) { - if (!slug) return WEBAPP_URL.replace("https://", "").replace("http://", ""); + if (!slug) return options.protocol ? WEBAPP_URL : WEBAPP_URL.replace("https://", "").replace("http://", ""); const orgFullOrigin = `${ options.protocol ? `${new URL(WEBAPP_URL).protocol}//` : "" }${slug}.${subdomainSuffix()}`;