Update password #6
@@ -324,7 +324,11 @@ 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) => {
|
||||||
// Left off here
|
// Left off here
|
||||||
let updated_hashed_password = hashing::hash_password(&payload.updated_password, &salt).unwrap();
|
let updated_salt_string = hashing::generate_salt().unwrap();
|
||||||
|
let mut updated_salt = simodels::user::salt::Salt::default();
|
||||||
|
updated_salt.salt = updated_salt_string.to_string();
|
||||||
|
updated_salt.id = salt.id.clone();
|
||||||
|
let updated_hashed_password = hashing::hash_password(&payload.updated_password, &updated_salt_string).unwrap();
|
||||||
|
|
||||||
match repo::user::update_password(&pool, &user, &updated_hashed_password).await {
|
match repo::user::update_password(&pool, &user, &updated_hashed_password).await {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user