change
Changes an account's password. The current credentials are checked with auth() first, so a successful change also leaves the account logged in.
Parameter | Description |
|---|---|
| The account's username. |
| The current password. |
| The new password. |
| Optional function that receives |
The account's keys don't change, only the password that protects them, so its data and public key stay the same. Without a callback, errors are logged to the console.
Examples
user.change("alice", "a strong password", "an even stronger one", err => {
if (err) return console.error(err)
console.log("password changed")
})
// Without a callback, errors are logged to the console.
user.change("alice", "an even stronger one", "the strongest yet")