settings/security: change password
This commit is contained in:
parent
a67c7559b9
commit
b05361510a
7 changed files with 121 additions and 1 deletions
|
|
@ -167,4 +167,16 @@ impl User {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn set_password(
|
||||
&self,
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
password: Option<&Password>,
|
||||
) -> Result<(), Error> {
|
||||
let password = password.map(|password| password.hash());
|
||||
|
||||
DatabaseUsers::set_password(conn, self.id.as_ref(), password).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue