delete
Deletes an account. The credentials are checked with auth() first, then the account's details are removed and the user is logged out.
Parameter | Description |
|---|---|
| The account's username. |
| The account's password. |
| Optional function that receives |
delete() replaces the account's keys and login details with null tombstones, which means nobody can log in to it or sign new updates for it. Two things are left behind:
Data the account wrote with
put(). Set it tonullfirst if it shouldn't be kept, see Nested data.The username, which stays taken, so it can't be used to create a new account.
Examples
user.delete("alice", "a strong password", err => {
if (err) return console.error(err)
console.log("account deleted")
})
// Without a callback, errors are logged to the console.
user.delete("bob", "another strong password")