From 6cf04856482a15d38aed85cdcd9e0df1a9f36397 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 4 Oct 2025 23:52:37 +0000 Subject: [PATCH] Redirect self route to username cgen-8c25da38059647319613ac79c25a0a15 --- client/pages/ProfilePassport.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/pages/ProfilePassport.tsx b/client/pages/ProfilePassport.tsx index c1a3a56e..faa691e5 100644 --- a/client/pages/ProfilePassport.tsx +++ b/client/pages/ProfilePassport.tsx @@ -81,6 +81,22 @@ const ProfilePassport = () => { if (isSelfRoute) { const currentUser = await aethexUserService.getCurrentUser(); + + if (currentUser?.username) { + if (!requestedUsername || requestedUsername === "me") { + navigate(`/passport/${currentUser.username}`, { replace: true }); + return; + } + + if ( + currentUser.username.toLowerCase() === requestedUsername.toLowerCase() && + currentUser.username !== requestedUsername + ) { + navigate(`/passport/${currentUser.username}`, { replace: true }); + return; + } + } + if (currentUser) { resolvedProfile = { ...currentUser,