• JMap.User.changePassword

    Change the user password on JMap server

    Parameters

    • newPassword: string

      The user new password

    • currentPassword: string

      The user current password

    Returns Promise<void>

    Throws

    Error if passwords are not strings or are empty, if new password is not valid or if newPassword's:

    • length is lower than the minimum length required (JMap Server)
    • strength is not high enough (JMap Cloud - at least 8 characters, at least one lowercase letter, one uppercase letter, one number, and one special character)

    Example

    // change the password to warl3pE with a current password, grl83n5
    JMap.User.changePassword("warl3pE", "grl83n5")
    .then(() => console.info("Password changed successfully"))
    .catch(error => console.error(error))