fix(auth) don't treat a rejected login as an expired session #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-login-401-session-expired"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A failed password login showed "Deine Sitzung ist abgelaufen. Bitte melde dich erneut an." above the correct "Login fehlgeschlagen!" message, and fired a pointless
POST /auth/refresh.apiClienttreated every 401 as an expired session: refresh → clear session →SESSION_EXPIRED_EVENT→ redirect to/login?reason=session_expired. For/auth/logina 401 just means wrong credentials.Fix
apiClient.posttakes an optionalApiRequestConfig. WithisCredentialExchange: true, a 401 skips the refresh/expiry flow and is thrown as a plainApiError, which the login page already handles.POST /auth/loginandPOST /passkey/authenticate/complete. All other requests behave as before.Verification
npm run build,npm run lint(2 existing warnings in an untouched file),npm run test(187 passed)/login. A correct login still lands on/recipe/list.🤖 Generated with Claude Code