mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
1 file changed
+5
-5
@@ -54,16 +54,16 @@ impl crate::Context<'_> {
|
|||||||
.determine_registration_user_id(Some(username), None, None)
|
.determine_registration_user_id(Some(username), None, None)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let password = HashedPassword::new(
|
let password =
|
||||||
&password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH)),
|
&password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH));
|
||||||
)?;
|
|
||||||
|
|
||||||
self.services
|
self.services
|
||||||
.users
|
.users
|
||||||
.create_local_account(&user_id, password, None)
|
.create_local_account(&user_id, HashedPassword::new(password)?, None)
|
||||||
.await;
|
.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 {
|
pub(super) async fn deactivate(&self, no_leave_rooms: bool, user_id: String) -> Result {
|
||||||
|
|||||||
Reference in new issue
Block a user