settings/security: change password
This commit is contained in:
parent
a67c7559b9
commit
b05361510a
7 changed files with 121 additions and 1 deletions
|
|
@ -149,4 +149,18 @@ impl Users {
|
|||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
|
||||
pub async fn set_password(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
id: &str,
|
||||
password: Option<&str>,
|
||||
) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult =
|
||||
sqlx::query_file!("queries/users/set_password.sql", password, id)
|
||||
.execute(conn)
|
||||
.await
|
||||
.map_err(handle_error)?;
|
||||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue