Move router.replace() outside the login try/catch so navigation failures (e.g. stale Vite HMR dynamic imports) don't mask a successful login. Falls back to window.location on nav error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>