1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Fix user registration from CLI

This commit is contained in:
Quentin Gliech
2021-12-15 11:14:34 +01:00
parent 3cda384fd4
commit 1d58d134a9

View File

@@ -42,9 +42,11 @@ impl ManageCommand {
SC::Register { username, password } => {
let config: DatabaseConfig = root.load_config()?;
let pool = config.connect().await?;
let mut txn = pool.begin().await?;
let hasher = Argon2::default();
let user = register_user(&pool, hasher, username, password).await?;
let user = register_user(&mut txn, hasher, username, password).await?;
txn.commit().await?;
info!(?user, "User registered");
Ok(())