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 <noreply@anthropic.com>
This commit is contained in:
parent
134cc5cc3f
commit
13618e4471
1 changed files with 3 additions and 1 deletions
|
|
@ -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))
|
||||
}, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue