diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -523,7 +523,21 @@ ); } let first_item = items[0].clone(); - Ok(Some(first_item)) + let user_id = first_item + .get(USERS_TABLE_PARTITION_KEY) + .ok_or(DBItemError { + attribute_name: USERS_TABLE_PARTITION_KEY, + attribute_value: None, + attribute_error: DBItemAttributeError::Missing, + })? + .as_s() + .map_err(|_| DBItemError { + attribute_name: USERS_TABLE_PARTITION_KEY, + attribute_value: first_item.get(USERS_TABLE_PARTITION_KEY).cloned(), + attribute_error: DBItemAttributeError::IncorrectType, + })?; + let result = self.get_item_from_users_table(user_id).await?; + Ok(result.item) } Ok(_) => { info!(