in Education by
I want to create a request from my application. (iOS and Android - Coded with Xamarin). Explaination: The request should trigger the WordPress action=lostpassword. - The user receives an email to reset his password in browser. OR The user will be able to set a new password. WordPress send a link to email - where the user has to verify, that he changed the password. Is there any chance to do this with a request to the REST API. Maybe any similar ideas? I have already tried: Plugins where function was given in documentation but not worked for me Manualy called wp-login.php?action=lostpassword with body { "redirect_to": "", "user_login": "[email protected]", "wp-submit": "Neues+Passwort" } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Create your custom api URL https://yourdomain/api/forgot_password.php Parameter login:[email protected] Create folder api in root and create file forgot_password.php forgot_password.php <?php include '../wp-load.php'; $login = $_REQUEST['login']; if ( empty( $login ) ) { $json = array( 'code' => '0', 'msg' => 'Please enter login user detail' ); echo json_encode( $json ); exit; } $userdata = get_user_by( 'email', $login); if ( empty( $userdata ) ) { $userdata = get_user_by( 'login', $login ); } if ( empty( $userdata ) ) { $json = array( 'code' => '101', 'msg' => 'User not found' ); echo json_encode( $json ); exit; } $user = new WP_User( intval( $userdata->ID ) ); $reset_key = get_password_reset_key( $user ); $wc_emails = WC()->mailer()->get_emails(); $wc_emails['WC_Email_Customer_Reset_Password']->trigger( $user->user_login, $reset_key ); $json = array( 'code' => '200', 'msg' => 'Password reset link has been sent to your registered email' ); echo json_encode( $json ); exit; ?> login is parameter name keep in mind. its working 100% for me try it

Related questions

0 votes
    All, I am trying to use syncfusion data grid in xamarin forms now.I have installed trial version as ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    In my password reset function the user can put in whatever he/she wants. It does not even needs ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    How to reset Splunk Admin password?...
asked Oct 31, 2020 in Technology by JackTerrance
0 votes
    I have laravel website and there is blog folder which contain wordpress blog. In my htaccess I want some ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to setup a guacamole instance to manage my servers accounts. It's working well when I' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I've try to do the following instruction of this document : LINK I used SAS authentication and added this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I'm trying to configure SSL for Kafka Connect REST API (2.11-2.1.0). The problem I tried two ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I have following Kubernetes REST API request GET https://theserver/api/v1/pods?includeUninitialized=true and included ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I want to update order status to complete using webapi here is my testing code : $data = array ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I am very new to creating and consuming REST web services in C#. I have programmed the data I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    ALL I am confused about the date field returned by microsoft academic rest api: JSON Example: { " ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    I would like to integrate SalesForce information into a .net MVC application. The samples on SalesForce website are ... .NET Thanks. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to execute a SOQL query using Salesforce REST API which will return 2,749 results. However, it seems ... the REST API. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me what is REST API in Informatica Cloud? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
...