feat: migrate update password to use db_* interface

This commit is contained in:
realaravinth
2022-05-11 19:52:20 +05:30
parent 374bbb2403
commit 748f48e0d2
2 changed files with 5 additions and 161 deletions

View File

@@ -57,15 +57,12 @@ async fn update_password_runner(
let new_hash = data.creds.password(&update.new_password)?;
sqlx::query!(
"UPDATE mcaptcha_users set password = $1
WHERE name = $2",
&new_hash,
&user,
)
.execute(&data.db)
.await?;
let p = db_core::NameHash {
username: user.to_owned(),
hash: new_hash,
};
data.dblib.update_password(&p).await?;
Ok(())
}