Registry Mirror
Skip to content

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Fixes #269

Root cause

In web/app/src/Root.tsx, once login sets token, the render path falls straight into the if (token) branch and mounts the signed-in Dashboard ("Hey 👋 / Signed in as…"). The redirect back to /authorize (or to the SAML IdP saml_continue URL) happens in a useEffect, which runs after that render is committed and painted. So the dashboard is visible for a frame before window.location.replace navigates away. That is the blink.

Fix

Before the if (token) branch, if a token exists and the resumption effect is about to navigate (isAuthorizeContext or isSamlIdpContinueURL(rawRedirectURL), the same conditions the effect uses), render the existing <h1>Loading...</h1> state instead of the dashboard. Redirect logic is unchanged. Plain /app logins without an authorize context still show the dashboard as before.

Checks

  • make fmt-ts: no changes
  • make lint-ts: clean
  • make build-app: builds
  • npx tsc --noEmit in web/app: clean
  • web/app has no test suite

Manual repro / verify

  1. make dev (and make build-app).
  2. From a client app, call authorizer-js authorize({ response_type: 'token' }) while logged out (or open /authorize?response_type=token&client_id=<id>&redirect_uri=<uri>&state=abc&scope=openid). You land on /app?state=...&redirect_uri=....
  3. Log in. Before: the "Hey 👋 / Signed in as …" screen flashes before redirecting. After: only "Loading..." shows until the redirect to /authorize completes and the client gets the token.
  4. Regression check: open /app directly (no query params), log in. The dashboard should still render and stay.

@lakhansamani
lakhansamani merged commit 5578477 into main Nov 26, 2026
3 checks passed
@lakhansamani
lakhansamani deleted the fix/269-login-redirect-flash branch November 26, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strange UI blinks after login

1 participant