(id: &Uuid, hash: &str)
| 144 | } |
| 145 | |
| 146 | pub async fn set_password_hash(id: &Uuid, hash: &str) -> Result<User, Error> { |
| 147 | let u: User = diesel::update(user::dsl::user.find(&fields::Uuid::from(id))) |
| 148 | .set(user::password_hash.eq(&hash)) |
| 149 | .get_result(&mut get_async_db_conn().await?) |
| 150 | .await |
| 151 | .map_err(|e| Error::from_diesel(e, id.to_string()))?; |
| 152 | info!(id = %id, "User password has been updated"); |
| 153 | Ok(u) |
| 154 | } |
| 155 | |
| 156 | // Validate password against security requirements. |
| 157 | // |
no test coverage detected