The claim page says whose account it is - #222
Open
ashwin-agami wants to merge 1 commit into
Open
Conversation
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
There was a problem hiding this comment.
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_htmlto accept ausernameand render it under the page title. - Pass the resolved username into the GET
/claimrender 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, |
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.
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_htmltakes the account it is for and shows it under the title. The handler already resolved it —_actionablereturns the username — so nothing new is looked up.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 presenttest_hosted_instruction_truth.pyand identical on cleanmain