diff --git a/apps/frontend/src/components/auth/register.tsx b/apps/frontend/src/components/auth/register.tsx index a5242a3c..698b2826 100644 --- a/apps/frontend/src/components/auth/register.tsx +++ b/apps/frontend/src/components/auth/register.tsx @@ -108,7 +108,13 @@ export function RegisterAfter({ const rootDomain = useMemo(() => { const url = new URL(process.env.frontendUrl!); - return url.protocol + '//' + url.host; + const hostname = url.hostname; + const parts = hostname.split('.'); + if (parts.length > 2) { + return url.protocol + '//' + url.hostname?.replace(/^[^.]+\./, ''); + } + + return process.env.frontendUrl; }, []); return ( @@ -156,7 +162,7 @@ export function RegisterAfter({ placeholder="Company" /> -