I have the same problem like this here: Wordpress REST API - send reset password link
I also tried it with post request to "mydomain/wplogin.php?action=lostpassword" with some parameters. But this didn`t work.
Can somebody explain me, how the wp_lostpassword_url() function works for this problem? It is described in the first answer of the linked post, but I don`t know how to use it.
https://codex.wordpress.org/Plugin_API/Filter_Reference/lostpassword_url
add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );
function my_lost_password_page( $lostpassword_url, $redirect ) {
return home_url( '/lostpassword/?redirect_to=' . $redirect );
}
Can somebody show me some lines of code where and how to use it?
Thanks very much.
Edit:
To make it more clear what I want to achieve. In my Ionic App I want to present a button for the user, which triggers after click a request to my wordpress page. Than the user should get a mail with the password reset link. The request should return a success or fail message. So I can present the user the fail or success message. Is this possible with the filter hook described above, or can I use a rest api route for this?