From 41ba5d0b151510dbf5c421e9ad2d4ae873df0bfa Mon Sep 17 00:00:00 2001 From: Developing-Gamer Date: Tue, 9 Jun 2026 10:34:30 -0700 Subject: [PATCH] Fix hosted navigation review --- apps/hosted-components/src/routes/__root.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/hosted-components/src/routes/__root.tsx b/apps/hosted-components/src/routes/__root.tsx index 77e5e5250..ebc437d2d 100644 --- a/apps/hosted-components/src/routes/__root.tsx +++ b/apps/hosted-components/src/routes/__root.tsx @@ -4,6 +4,7 @@ import { publishableClientKeyNotNecessarySentinel } from '@hexclave/shared/dist/ import { runAsynchronously } from '@hexclave/shared/dist/utils/promises'; import { validateRedirectUrl } from '@hexclave/shared/dist/utils/redirect-urls'; import { isRelative } from '@hexclave/shared/dist/utils/urls'; +import { throwErr } from '@hexclave/shared/dist/utils/errors'; import { HeadContent, Outlet, @@ -65,7 +66,7 @@ function useHostedComponentsNavigate() { await navigate({ hash: to.slice(1) }); } else { if (!isTrustedNavigationTarget(to)) { - throw new Error(`Refusing to navigate to untrusted URL: ${to}`); + throw new Error("Refusing to navigate to an untrusted URL"); } await navigate({ href: to }); } @@ -195,9 +196,11 @@ function RootComponent() { return ; } + const app = hexclaveApp ?? throwErr("RootComponent expected a HexclaveClientApp after project ID validation."); + return ( - +