Repository navigation
fix(auth): show credential error instead of session expired on failed login - #22
Merged
Merged
Conversation
… login The global 401 handler in apiFetch discarded the response body and threw 'Sesión expirada' for every 401, including a failed login attempt, so users saw a misleading session-expired message instead of a credential validation error. It also dispatched the helios-unauthorized event on a bad login. Exclude /api/auth/login from the global handler so the real error flows through, and map a 401 in Login to the localized login.error string. Closes #14
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.
Closes #14.
A failed login showed "Session expired" instead of the real validation
error. The global 401 handler treated every 401 as an expired session and
discarded the response body before the error message could surface, also
firing the unauthorized event.
api-client.ts: exclude/api/auth/loginfrom the global 401 handlerso the real error flows through.
Login.tsx: map a 401 to the localizedlogin.errormessage.Verified: tsc 0 err, lint 0 err, server 46/46, build OK, and against the
production backend the login shows "Usuario o contraseña incorrectos"
(not "sesión expirada") with no spurious unauthorized event. The built
chunk (
index-CykTVXSD.js) is already deployed and matches.