dominic-ks / bdvs-password-reset

WordPress - Allow users to reset their password using a random code via the REST API
GNU General Public License v3.0
9 stars 3 forks source link

Reset password code is not in digit format. #21

Closed itsSagarBro closed 9 months ago

itsSagarBro commented 9 months ago

When I am calling for API for resetting the password "https://myurl.com/wp-json/bdpwr/v1/reset-password?email=mymail" " the mail is receiving very well, but the code I have received is random characters, but I need a 4 or a 6 digit OTP instead of Random characters.

image

itsSagarBro commented 9 months ago

@dominic-ks

dominic-ks commented 9 months ago

Hello @itsSagarBro, it's not wrong, that is the code that the plugin has produced. The defaults for the code were changed recently to improve security in the default set up and will need to remain this way until we have some sort of rate limiting or ability to block users from resetting passwords after a given number of failed reset attempts.

Check out the notice in the README.md:

As noted there, you can change the code using the bdpwr_code_length and bdpwr_selection_string filters. Examples of these are documented on wordpress.org:

I'm going to close this, because I don't believe there is an issue here, but let me know if you need anything else.

itsSagarBro commented 9 months ago

Thanks for the reply, I have already figured out how to do it, just by changing parameters in functions.php, according to my use-case.

dominic-ks commented 9 months ago

@itsSagarBro Great, glad it's working for you.