Reset Password

After the successful registration of a user, you can reset the password using the following code snippet. While calling the resetPassword() method, a reset password link will be generated and sent to the user's Email address. The userManagement reference used in the below code snippet is the component instance.  EmailId, Platform type, and Zaid are the mandatory attributes.

Create a Configuration JSON

JSON objects containing the registration details of a particular user is created as given below,

Copied//Create Config Object for the user
    var signupConfig = {
        platform_type: 'web',
        zaid: 10014774358
    };
    var userConfig = {
        last_name: 'S',
        email_id: 'santhosh.suresh+nodeSDKTest1@zohocorp.com'
    };

Reset the Password

These objects are passed as arguments to the registerUser() method which returns a promise.

The promise returned will be resolved to an object which is a JSON.

Copied//Pass the configuration to reset the password which in turn returns a promise
let userManagement = app.userManagement();
let resetPromise = userManagement.resetPassword(signupConfig, userConfig);
resetPromise.then(response => {
      console.log(response);
});