From 17e13249197741fde0a8f99f666d753295d9eb8e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 15 Nov 2025 05:32:53 +0000 Subject: [PATCH] Make passport link root on subdomains cgen-cb74c49f8bb24985bc7cfb884473e720 --- client/components/Layout.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/components/Layout.tsx b/client/components/Layout.tsx index ffa15cc9..1d9bbd04 100644 --- a/client/components/Layout.tsx +++ b/client/components/Layout.tsx @@ -122,7 +122,23 @@ export default function CodeLayout({ children, hideFooter }: LayoutProps) { { name: "Contact", href: "/contact" }, ]; - const passportHref = profile?.username + const isSubdomainHost = (() => { + try { + const hostname = typeof window !== "undefined" ? window.location.hostname : ""; + if (!hostname) return false; + if (hostname.includes("aethex.me") || hostname.includes("aethex.space")) { + const parts = hostname.split("."); + return parts.length > 2; + } + return false; + } catch (e) { + return false; + } + })(); + + const passportHref = isSubdomainHost + ? "/" + : profile?.username ? `/passport/${profile.username}` : "/passport/me";