Skip to content

fix(web): legacy password sign-in stuck on #/login#190

Merged
finedesignz merged 1 commit into
mainfrom
fix/legacy-login-route-stuck
May 30, 2026
Merged

fix(web): legacy password sign-in stuck on #/login#190
finedesignz merged 1 commit into
mainfrom
fix/legacy-login-route-stuck

Conversation

@finedesignz
Copy link
Copy Markdown
Owner

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.tsx routes off window.location.hash. The route === '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 calls signIn() to set state but never changes the hash (magic-link escapes via the /auth/callback/ redirect). So route stays '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 build clean.
  • Will Playwright-verify end-to-end (login → lands on app, no reload) post-deploy.

🤖 Generated with Claude Code

…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>
@finedesignz finedesignz merged commit ce5e469 into main May 30, 2026
2 checks passed
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.

1 participant