Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mutation to send password reset email #491

Closed
kellenmace opened this issue Aug 15, 2018 · 1 comment · Fixed by #586
Closed

Add mutation to send password reset email #491

kellenmace opened this issue Aug 15, 2018 · 1 comment · Fixed by #586
Labels
Status: In Review Needs to be reviewed by a project maintainer before merge Type: Enhancement New feature or request Type: Feature

Comments

@kellenmace
Copy link
Contributor

kellenmace commented Aug 15, 2018

The intent of this mutation is to mimic WP's retrieve_password() function that runs when the "Lost Password" form is submitted: https://cloudup.com/cDFg7wCo1ig

I envision it working like this:

  1. The user is presented with a form field in which they can enter their username or password.
  2. When the form is submitted, the sendPasswordResetEmail mutation is used and accepts that username/password as an argument.
  3. sendPasswordResetEmail gets the user, calls WP's get_password_reset_key(), which generates a password reset hash, stores it as the user_activation_key for that user in the database, then returns the key.
  4. The user is sent an email with a password reset link that contains the reset key and their login, such as domain.com/wp-login.php?action=rp&key=12345&login=myusername. Both the email subject and body are filterable, though, so the password reset link can easily be filtered to point to the frontend URL for a headless WP site instead, for instance.
@kellenmace
Copy link
Contributor Author

I submitted a PR for this feature.

Here is a gif showing the new feature in action –
sendpasswordresetemail

@CodeProKid CodeProKid added this to the 0.1.0 milestone Sep 4, 2018
@CodeProKid CodeProKid added Type: Enhancement New feature or request Type: Feature labels Sep 4, 2018
@CodeProKid CodeProKid added the Status: In Review Needs to be reviewed by a project maintainer before merge label Sep 11, 2018
@CodeProKid CodeProKid modified the milestones: 0.1.0, 0.2.0 Oct 30, 2018
jasonbahl added a commit to jasonbahl/wp-graphql that referenced this issue Nov 23, 2018
- Original work by @kellenmace, this just updates it to fit with the v0.1.0 refactored architecture
hughdevore added a commit that referenced this issue Nov 23, 2018
…et-email-mutation

#491 - Send Password Reset Mutation
@CodeProKid CodeProKid removed this from the 0.2.2 milestone Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Review Needs to be reviewed by a project maintainer before merge Type: Enhancement New feature or request Type: Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants