Skip to content

The claim page says whose account it is - #222

Open
ashwin-agami wants to merge 1 commit into
mainfrom
claim-page-names-the-account
Open

The claim page says whose account it is#222
ashwin-agami wants to merge 1 commit into
mainfrom
claim-page-names-the-account

Conversation

@ashwin-agami

Copy link
Copy Markdown
Contributor

Summary

Somebody following a setup or reset link was asked to choose a password with no indication of which account it was for.

A link is shared out of band, so the person holding it may have been sent the wrong one, or two of them. That was tolerable while the only link set a first password on an account the recipient was expecting. It is not now that a link can replace a working password — following the wrong one silently locks somebody out of their own account, and nothing on the page would have told them.

Reported from using it: "On that screen we are not showing which email that is relevant for."

Changes

  • claim_page_html takes the account it is for and shows it under the title. The handler already resolved it — _actionable returns the username — so nothing new is looked up.
  • Shown on both purposes and on the re-render after a rejected password.

Disclosure

None added. Whoever holds the link already holds a token whose payload is base64url and carries the same address in the clear — the module docstring says exactly that. This turns something they could decode into something they can check.

Checklist

  • Spec: line present
  • Test asserts both purposes and the short-password re-render — the render most easily forgotten, and the one somebody is looking at when already confused
  • Mutation-checked: drop the name and the test fails
  • Full suite: 4517 passed, 7 failed — the 7 are pre-existing in test_hosted_instruction_truth.py and identical on clean main
  • Public repo: synthetic addresses only

Somebody following a setup or reset link was asked to choose a password with
no indication of which account it belonged to. A link is shared out of band,
so the person holding it may have been sent the wrong one, or two of them.

That was tolerable while the only link set a FIRST password on an account the
recipient was expecting. It is not now that a link can REPLACE a working one:
following the wrong link silently locks somebody out of their own account,
and nothing on the page would have told them.

It discloses nothing new. Whoever holds the link already holds a token whose
payload is base64url and carries the same address in the clear — the module
note says so. This turns something they could decode into something they can
check.

Asserted on both purposes and on the re-render after a rejected password,
which is the render most easily forgotten and the one somebody is staring at
when they are already confused. Mutation-checked: drop the name and it fails.

Spec: ACE-108
Copilot AI lite review requested due to automatic review settings August 11, 2026 06:23

Copilot AI left a comment

Copy link
Copy Markdown

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 improves the /claim (setup/reset password) UX by displaying which account (username/email) the link applies to, reducing the risk of a user setting/resetting the wrong account’s password when links are shared out-of-band.

Changes:

  • Extend claim_page_html to accept a username and render it under the page title.
  • Pass the resolved username into the GET /claim render and the short-password re-render path.
  • Add a regression test covering both setup/reset purposes and the short-password re-render.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/agami-core/src/onboarding.py Render the target account on the claim page and preserve it on validation re-render.
tests/test_onboarding.py Add test asserting the claim page shows the relevant account for both setup and reset, including the short-password re-render.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 326 to +333
password = form.get("password", "")
if not _MIN_PASSWORD_LEN <= len(password) <= _MAX_PASSWORD_LEN:
return HTMLResponse(
claim_page_html(token, purpose, error=f"Use at least {_MIN_PASSWORD_LEN} characters."),
claim_page_html(
token,
purpose,
error=f"Use at least {_MIN_PASSWORD_LEN} characters.",
username=username,
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.

2 participants