pub async fn set_password(
pool: &PgPool,
actor: Option<&Actor>,
id: Uuid,
password: &str,
) -> AppResult<()>Expand description
Sets the password of a local account. actor = None is used by the CLI.
ยงInvariants
- Permission: administrator (403); without an actor (CLI) no check. Single-sign-on accounts have no local password (400).
- Locks: none.
- Data: the password is stored only as a hash; all sessions of the user are deleted.
- Audit:
user.password. - Notifications / webhooks: none.
- Atomic: one transaction.