Open mathiasastrom opened 6 years ago
Hi Mathias,
Thanks for pointing this out! When I added the reset endpoint I just looked at what was in core at the time and how others had solved it and found that it worked but was a little bit buggy. I did not know about this new function!
I don't think compatibility is an issue since this plugin is aimed towards new development with WordPress (REST) :)
Would you mind turning your fix into a PR?
Great plugin, saved me a great deal of pain.
Experienced buggy behaviour when I tried to reset the password through the WP REST api callback, the reset key was never updating and it was stuck in the same corrupt key. Much needed logic that was in your reset_password() method already exists in the core function: get_password_reset_key() - The function was added in WP 4.4 and should be safe to use I believe. (Depending on which WP versions you are supporting)
Feel free to use/test my modified method below: