This method is very similar to the forgot password feature. But unlike forgot password, here it is important for a user to be logged into his account first. To ensure the security of a user account, we send a verification code to the phone number associated with user account and return you a confirmation method.

Change password function accepts the following arguments

passwordstringshould be minimum six character long

This method returns the following code in form of promise


verification code sent to phone number and you use the confirmation method returned in the response of promise to verify the user.


data format is invalid


user is required to be logged in


failed to send code to phone number


After submitting change password request, we send a verification code to the phone number associated with the user's accounts. As a result, we also return you a confirmation function, so that you could proceed with the change password operation after prompting the user about the verification code.

This function receives a single argument as illustrated below


codestringsix digit long numeric code

Upon execution, this method returns the following code in the form of promise


password has been updated


verification code is invalid


failed to verify the verification code


failed to update the profile

Use of changePassword method has been illustrated in the example below

// Variable to hold the confirmChangePassword
// method so that it could be used afterwards
var confirm = null;
// Get user data from the inputs and
// Submit request to the server
auth.changePassword(password).then((res) => {
  // Got the response
  // So checkout the response code
  switch(res.code) {
    case "PHONE-CODE-SENT": 
      // Verification code has been sent
      confirm = res.confirm;
// After getting response from change password request
// Prompt the user about the verification code
// and submit it to server with the confirm method
confirm(code).then((res) => {
  // Got the response
  switch(res.code) {
        // Password has been updated