Skip to content

fix handling of failed login as bad request#631

Merged
mabiede merged 2 commits into
mainfrom
bug/http-code-responses
Jul 16, 2026
Merged

fix handling of failed login as bad request#631
mabiede merged 2 commits into
mainfrom
bug/http-code-responses

Conversation

@mabiede

@mabiede mabiede commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mabiede mabiede self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Unauthorized to Http_response.http_error, plus unauthorized / unauthorized_on_error helpers.
  • Update HTML error handling to support an unauthorized redirect flow (including intended URL + flash refill + X-Auth-Error header) and adjust AccessDenied to return 403 Forbidden.
  • Switch public_login POST error mapping from “bad request” to the new “unauthorized” handling, and add a new Pool_message.Error.Unauthorized with 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.

Comment thread pool/web/handler/public_login.ml
Comment thread pool/web/handler/public_login.ml Outdated
Comment thread pool/web/response/entity.ml Outdated
Comment thread pool/web/response/http_response.ml Outdated
Comment thread pool/web/response/http_response.mli Outdated
Comment thread pool/web/response/http_response.ml Outdated
@mabiede
mabiede requested a review from PossessedC0bra July 16, 2026 13:43
@mabiede
mabiede force-pushed the bug/http-code-responses branch from 8d85fc7 to e97f473 Compare July 16, 2026 13:52
@mabiede
mabiede merged commit 6fae2a0 into main Jul 16, 2026
9 checks passed
@mabiede
mabiede deleted the bug/http-code-responses branch July 16, 2026 14:03
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.

3 participants