[wp-trac] [WordPress Trac] #41672: REST create user: existing_user_login is returned before existing_user_email
WordPress Trac
noreply at wordpress.org
Sat Aug 19 01:37:11 UTC 2017
#41672: REST create user: existing_user_login is returned before
existing_user_email
-------------------------+-----------------------------
Reporter: bbrian | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.8.1
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
When I post to `/wp-json/wp/v2/users` to create a user:
{{{
{
"email": "brianhenryie at gmail.com",
"username": "brianhenryie",
"password": "password"
}
}}}
and a user with that username and email address exists, the response is:
{{{
{
"code": "existing_user_login",
"message": "Sorry, that username already exists!",
"data": null
}
}}}
whereas a more useful response would be the existing_user_email response:
{{{
{
"code": "existing_user_email",
"message": "Sorry, that email address is already used!",
"data": null
}
}}}
which is learned once the original POST is updated with a new username.
i.e. existing_user_email tells a user if they already have an account.
This information could be used to attempt to log in.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41672>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list