Skip to content

user/edit/password: check haveibeenpwned.com - #1744

Open
alxndrsn wants to merge 46 commits into
getodk:masterfrom
alxndrsn:set-password-check-pwned
Open

user/edit/password: check haveibeenpwned.com#1744
alxndrsn wants to merge 46 commits into
getodk:masterfrom
alxndrsn:set-password-check-pwned

Conversation

@alxndrsn

@alxndrsn alxndrsn commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes getodk/central#2150

Screenshot_2026-08-12_10-15-24

What has been done to verify that this works as intended?

  • tested manually
  • ci
  • new tests

Why is this the best possible solution? Were any other approaches considered?

  • request to haveibeenpwned.com API could be done server-side, but it introduces some issues with
  • include a timeout in the fetch() call?
  • manually cache layer could be removed; maybe haveibeenpwned.com API already offers HTTP caching which would be adequate?

How does this change impact users? Describe intentional behavior changes from code updates. What are the regression risks?

  • help users choose better passwords
  • might make changing password slower or more frustrating, especially if haveibeenpwned API is slow or down

Does this change require updates to user documentation? If so, please file an issue here and include the link below.

I don't think so.

@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 34c9950

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread apps/central/src/components/user/edit/password.vue Outdated
@alxndrsn
alxndrsn marked this pull request as ready for review August 12, 2026 08:41
@alxndrsn
alxndrsn requested a review from matthew-white August 12, 2026 08:41
@alxndrsn alxndrsn moved this to ✏️ in progress in ODK Central Aug 12, 2026

@matthew-white matthew-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's looking nice! I've added several comments, but a lot of them are just hints for working with the Frontend codebase.

Comment thread apps/central/src/components/user/edit/password.vue Outdated
Comment thread apps/central/src/components/user/edit/password.vue
Comment thread apps/central/src/components/user/edit/password.vue Outdated
Comment thread apps/central/src/components/user/edit/password.vue
Comment thread apps/central/src/components/user/edit/password.vue Outdated
Comment on lines +109 to +110
(async () => {
const isPwned = await checkPasswordPwnage(this.request, this.newPassword);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm noticing the use of this.newPassword here and below, but I'm realizing that the <form-group> isn't disabled during the request. So users could theoretically change this.newPassword between the pwned check and the request to Backend. We don't usually disable form fields during requests, but I think that'd be a reasonable choice here in order to prevent this unlikely but awkward possibility. Alternatively, you could save this.newPassword to a local variable at the start of validate(), then use that local variable instead of the potentially changing this.newPassword.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't usually disable form fields during requests

Why not?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIRC issa had a preference along those lines. The idea was to not lock down parts of the UI if we don't need to. If the user wants to edit those fields during the request for some reason (perhaps anticipating an error response), we don't restrict them from doing so.

In terms of code complexity, it's probably a wash. It's a little extra to disable fields during requests, but usually it's just one or two attributes or props. But this is the downside of not disabling them, that we have to consider the possibility of the data property changing during the request.

I don't have a strong preference either way. Maybe it's something we could ask Nicole or the larger team on Slack.

Comment thread apps/central/src/util/password.js Outdated
Comment thread apps/central/test/components/user/edit/password.spec.js
Comment thread apps/central/test/components/user/edit/password.spec.js
Comment thread apps/central/test/components/user/edit/password.spec.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✏️ in progress

Development

Successfully merging this pull request may close these issues.

Check haveibeenpwned when setting a password

2 participants