From d4f6c053bcfccef198f66fabec752c2bb8aeca26 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Thu, 2 Jul 2026 16:41:33 +0100 Subject: [PATCH] fix: Log the set password when creating users Closes #1894 --- src/admin/user/commands.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/admin/user/commands.rs b/src/admin/user/commands.rs index 23c63cd71..26dadc5b5 100644 --- a/src/admin/user/commands.rs +++ b/src/admin/user/commands.rs @@ -54,16 +54,16 @@ impl crate::Context<'_> { .determine_registration_user_id(Some(username), None, None) .await?; - let password = HashedPassword::new( - &password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH)), - )?; + let password = + &password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH)); self.services .users - .create_local_account(&user_id, password, None) + .create_local_account(&user_id, HashedPassword::new(password)?, None) .await; - self.write_str(&format!("Created user {user_id}")).await + self.write_str(&format!("Created user {user_id} with password `{password}`")) + .await } pub(super) async fn deactivate(&self, no_leave_rooms: bool, user_id: String) -> Result {