diff --git a/frontend/apps/gate/src/components/SignUp/SignUpBox.tsx b/frontend/apps/gate/src/components/SignUp/SignUpBox.tsx index d33c9948a5..a5fca2cf0c 100644 --- a/frontend/apps/gate/src/components/SignUp/SignUpBox.tsx +++ b/frontend/apps/gate/src/components/SignUp/SignUpBox.tsx @@ -37,7 +37,12 @@ export default function SignUpBox(): JSX.Element { const {isDesignEnabled} = useDesign(); const [flowError, setFlowError] = useState(null); - const signInUrl = ROUTES.AUTH.SIGN_IN; + // For React Router navigate() — basename is handled by the router. + const signInPath = ROUTES.AUTH.SIGN_IN; + // For window.location.href and new URL() (via afterSignUpUrl) — React Router basename is + // bypassed, so an absolute URL with origin + base path must be constructed explicitly. + // Vite appends a trailing slash to BASE_URL. + const afterSignUpUrl = `${window.location.origin}${import.meta.env.BASE_URL.replace(/\/$/, '')}${signInPath}`; const renderFlowContent = ( components: EmbeddedFlowComponent[], @@ -103,7 +108,7 @@ export default function SignUpBox(): JSX.Element { logoDisplay={!isDesignEnabled ? {xs: 'flex', md: 'none'} : {display: 'none'}} > { if (response?.failureReason) { setFlowError(response.failureReason as string); @@ -151,7 +156,7 @@ export default function SignUpBox(): JSX.Element {