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

username

The account's username.

password

The account's password.

callback

Optional function that receives null on success, or an error message.

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:

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")