From 13618e4471bdcae26520fb5fcf2ec60c726cdc94 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Thu, 9 Jul 2026 20:19:36 +0000 Subject: [PATCH] Fix expired session showing EmbeddedFallback in portal iframe When the JWT expired, AuthGate redirected window.location to /auth/login which loaded inside the portal iframe. The portal detected window.self !== window.top and showed the EmbeddedFallback ("This app isn't available yet") instead of the login page. Redirect window.top instead so the portal itself navigates to /login. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/AuthGate.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/AuthGate.tsx b/frontend/src/components/AuthGate.tsx index 7fa8b9c..9492ba3 100644 --- a/frontend/src/components/AuthGate.tsx +++ b/frontend/src/components/AuthGate.tsx @@ -28,7 +28,9 @@ export default function AuthGate({ children }: { children: ReactNode }) { caps: data.caps ?? [], })) .catch(() => { - window.location.href = '/auth/login?redirect=' + encodeURIComponent(window.location.pathname) + // Redirect the top-level window, not the iframe, so the portal + // navigates to login rather than loading inside itself (EmbeddedFallback). + ;(window.top ?? window).location.href = '/login' }) .finally(() => setChecking(false)) }, [])