fix(web): legacy password sign-in stuck on #/login#190
Merged
Conversation
…advanced) App.tsx routes purely off window.location.hash. The legacy password flow calls signIn() to set auth state but — unlike magic-link, which redirects via /auth/callback → / — never changes the hash. So route stays 'login' and App's `route === 'login'` gate (added in #188 to harden against stale tokens) re-renders <Login> forever despite valid token + cookie + profile. Symptom: clicking Sign in does nothing. Fix: signIn() navigates to #/ when on the login route. Magic-link and deep links unaffected (guarded on hash). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clicking Sign in (password mode) does nothing — the app stays on the login screen even though login succeeds (POST /api/auth/login → 200, /api/profile → 200, token + csrf cookie + profile all valid). Reproduced live with Playwright.
Root cause
App.tsxroutes offwindow.location.hash. Theroute === 'login'gate (App.tsx:206, added in #188 to stop a stale-token blank screen) returns<Login>before the authenticated block. The legacy password flow callssignIn()to set state but never changes the hash (magic-link escapes via the/auth/callback→/redirect). Soroutestays'login'→ Login re-renders forever.Fix
useAuth.signIn()navigates to#/when sitting on the login route. One-liner, guarded on hash so magic-link and deep links are untouched.Verification
tsc -b && vite buildclean.🤖 Generated with Claude Code