From 3551516877cfcf4359e90ea6c873c5a44560db2c Mon Sep 17 00:00:00 2001 From: Nevo David Date: Tue, 4 Jun 2024 13:42:39 +0700 Subject: [PATCH] feat: fix url --- apps/frontend/src/components/auth/register.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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" /> -
+
By registering you agree to our{' '}