fix handling of failed login as bad request#631
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the web response error model with an explicit Unauthorized case and updates the public login POST flow to treat certain failures as unauthorized (redirecting to the login page while preserving intended destination and some form values).
Changes:
- Add
UnauthorizedtoHttp_response.http_error, plusunauthorized/unauthorized_on_errorhelpers. - Update HTML error handling to support an unauthorized redirect flow (including intended URL + flash refill +
X-Auth-Errorheader) and adjustAccessDeniedto return403 Forbidden. - Switch
public_loginPOST error mapping from “bad request” to the new “unauthorized” handling, and add a newPool_message.Error.Unauthorizedwith EN/DE translations.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pool/web/response/http_response.mli |
Exposes Unauthorized and new helper functions in the response API. |
pool/web/response/http_response.ml |
Implements unauthorized redirect handling and refactors error response building. |
pool/web/response/entity.ml |
Extends http_error with Unauthorized and provides constructors/mappers. |
pool/web/handler/public_login.ml |
Changes login POST error handling to use unauthorized_on_error. |
pool/pool_message/pool_message_error.ml |
Adds a new Unauthorized error variant to the message error type. |
pool/app/pool_common/locales/locales_en.ml |
Adds EN translation for Unauthorized. |
pool/app/pool_common/locales/locales_de.ml |
Updates DE login-invalid wording and adds DE translation for Unauthorized. |
mabiede
force-pushed
the
bug/http-code-responses
branch
from
July 16, 2026 13:52
8d85fc7 to
e97f473
Compare
PossessedC0bra
approved these changes
Jul 16, 2026
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.
No description provided.