Update password #6

Merged
phoenix merged 13 commits from update_password into main 2026-09-22 12:47:43 -04:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit d126bc7e0a - Show all commits
+4 -3
View File
@@ -331,9 +331,10 @@ pub mod endpoint {
match repo::salt::get(&pool, &user.salt_id).await { match repo::salt::get(&pool, &user.salt_id).await {
Ok(salt) => { Ok(salt) => {
let updated_salt_string = hashing::generate_salt().unwrap(); let updated_salt_string = hashing::generate_salt().unwrap();
let mut updated_salt = simodels::user::salt::Salt::default(); let updated_salt = simodels::user::salt::Salt {
updated_salt.salt = updated_salt_string.to_string(); salt: updated_salt_string.to_string(),
updated_salt.id = salt.id.clone(); id: salt.id,
};
let updated_hashed_password = hashing::hash_password( let updated_hashed_password = hashing::hash_password(
&payload.updated_password, &payload.updated_password,
&updated_salt_string, &updated_salt_string,
+2 -2
View File
@@ -60,11 +60,11 @@ pub mod user {
.await .await
{ {
Ok(r) => { Ok(r) => {
return if r.rows_affected() > 0 { if r.rows_affected() > 0 {
Ok(true) Ok(true)
} else { } else {
Ok(false) Ok(false)
}; }
} }
Err(err) => Err(err), Err(err) => Err(err),
} }