fix bug and sqlx prepare

This commit is contained in:
red binder 2026-08-10 22:08:17 +02:00
commit fa063d78fb
3 changed files with 56 additions and 7 deletions

View file

@ -200,15 +200,9 @@ pub async fn forgotten_password(
let nintendo_hash = crate::account::account::generate_password(pid, &cleartext_password)
.ok_or(UNAUTHORIZED_DEVICE_ERROR)?;
let hashed_password = bcrypt::hash(nintendo_hash, 10)
.map_err(|e| {
eprintln!("bcrypt error: {e}");
UNAUTHORIZED_DEVICE_ERROR
})?;
let update_result = sqlx::query!(
"UPDATE users SET password = $1 WHERE pid = $2",
hashed_password,
nintendo_hash,
pid
)
.execute(db)