diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index 837b0bcf9fc..a6ad5df5c86 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -449,16 +449,20 @@ pub async fn change_password( let new_password_hash = utils::user::password::generate_password_hash(new_password.get_secret())?; - let _ = state - .global_store - .update_user_by_user_id( - user.get_user_id(), - diesel_models::user::UserUpdate::PasswordUpdate { - password: new_password_hash, - }, - ) - .await - .change_context(UserErrors::InternalServerError)?; + let _ = state + .global_store + .update_user_by_user_id( + user.get_user_id(), + diesel_models::user::UserUpdate::PasswordUpdate { + password: new_password_hash, + }, + ) + .await + .map_err(|e| { + Report::new(UserErrors::InternalServerError) + .attach_printable(format!("Failed to update password for user_id: {}", user.get_user_id())) + .attach_printable(e) + })?; let _ = auth::blacklist::insert_user_in_blacklist(&state, user.get_user_id()) .await