Skip to content

setPassword

Sahri Riza Umami edited this page Jun 6, 2018 · 3 revisions

Changes the password for the user.
If a new recovery email address is specified, then the error EMAIL_UNCONFIRMED is returned and the password change will not be applied until the new recovery email address has been confirmed.
The application should periodically call getPasswordState to check whether the new email address has been confirmed.

setPassword(old_password, new_password, new_hint, set_recovery_email_address, new_recovery_email_address)
Field Type Description
old_password string Previous password of the user
new_password string New password of the user; may be empty to remove the password
new_hint string New password hint, can be empty
set_recovery_email_address Bool Pass true if the recovery email address should be changed
new_recovery_email_address string New recovery email address; may be empty

Example

  • Changes the password for the user.

    setPassword('er678ikjhd', 'm98TFcfhoo875', 'anon i mouse, 1, 'anu@email.com')

    Response:

    {
      ["@type"] = "passwordState",
      has_password = true,
      has_recovery_email_address = true,
      password_hint = "anon i mouse",
      unconfirmed_recovery_email_address_pattern = ""
    }

Frequently Asked Questions
The Functions

Clone this wiki locally