Reset password

Once a user has been successfully registered, you can reset their password using the following code snippet. When the the forgotPassword() method is called, a reset password link will be generated and sent to the user's email address. Only the user's email address is a mandatory attribute. The userManagement reference used in the code snippet below is the  component instance.

JSON objects containing the registration details of a particular user are created as follows:

Copied//Create an object with the details such as email Id, platform and redirect url
    var data = {
        "email_id": "santhosh.suresh+ut1@zohocorp.com",
        "platform_type": "web",
        "redirect_url": "https://catalyst.zoho.com"
    };

This object is passed as an argument to the forgotPassword() method.

The promise returned will be resolved to an object in which the content key contains a confirmation message.

Copied//Reset password by passing the details. This in turn returns a promise.
var userManagement = catalyst.userManagement;
var forgotPromise = userManagement.forgotPassword(data);
forgotPromise
        .then((response) => {
            console.log(response.content);
        })
        .catch((err) => {
            console.log(err);
        });