updatePassword

Deprecation Notice

This SDK is deprecated in favor of the Core and UI JS SDKs. See Migrating to the latest SDKs to use the latest Core and UI SDKs.

Support for the Legacy JS SDK ends on 28 February, 2021.

reach5('updatePassword', {
  email: string,
  password: string,
  oldPassword: string,
  verificationCode: string,
  accessToken: string,
  phoneNumber: string,
  callback: function,
})

About this command

Update user’s password. To be accepted, the request must include, in addition to the new password, either:

  • A fresh accessToken (less than 5 minutes old)

  • An accessToken and the user’s oldPassword

  • For the request password reset flow, the email or phoneNumber and the verificationCode associated

Examples

reach5('updatePassword', {
  accessToken: 'eyJ0eXAiOiJKV1QiL...',
  password: 'N5uiKvve'
}, function(err, result) {
  if (err) {
    // Handle error
    return;
  }
  // do something with result
});

Parameters

accessToken string

User’s access token.

password string

User’s password.

oldPassword string

Old password.

verificationCode string

Verification code for request password reset flow.

email string

User’s email

phoneNumber string

User’s phone number.

Both the international format and the national conventions of the account’s country are accepted if configured in account settings.

callback string

Event callback that was used with on.