Page MenuHomePhabricator

API resetpassword should allow user and email use together
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • send a post request to https://zh.wikipedia.org/w/api.php with params:
    • action: resetpassword
    • format: json
    • user: Example
    • email: user@example.com
    • token: <token>

What happens?:

{
    "error": {
        "code": "invalidparammix",
        "info": "The parameters \"user\" and \"email\" can not be used together.",
        "docref": "See https://zh.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; for notice of API deprecations and breaking changes."
    },
    "servedby": "[redacted]"
}

What should have happened instead?:
Because of EPR, some accounts require both username and email to request a password reset. The API should allow user and email use together.

Event Timeline

@dmaza is password reset something that CommTech continues to own? I don't see it in our maintenance page. https://meta.wikimedia.org/wiki/Community_Tech/Maintenance

@JTannerWMF does your team use the API resetpassword feature? It looks like it's broken and want to make sure this ticket is a one-off.

This seems to have always been the case since it's implementation in rMW54d58ef50665: API changes for AuthManager.

Though, it's possible this restriction just wasn't removed from the API endpoint (but was from the UI, if it existed) when Password-Reset-Update stuff happened.

Change 1003815 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] ApiResetPassword: Allow user and email parameters for reset

https://gerrit.wikimedia.org/r/1003815

Reedy triaged this task as Low priority.Feb 15 2024, 7:11 PM

Change 1003815 merged by jenkins-bot:

[mediawiki/core@master] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1003815

Change 1007367 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_41] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007367

Change 1007368 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_40] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007368

Change 1007369 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_39] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007369

Change 1007369 merged by jenkins-bot:

[mediawiki/core@REL1_39] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007369

Change 1007368 merged by jenkins-bot:

[mediawiki/core@REL1_40] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007368

Change 1007367 merged by jenkins-bot:

[mediawiki/core@REL1_41] ApiResetPassword: Allow both user and email parameters to be passed for reset

https://gerrit.wikimedia.org/r/1007367

Umherirrender assigned this task to Reedy.