mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: migrate update password to use db_* interface
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user