You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
data-model: simplify users and sessions
This commit is contained in:
@ -204,7 +204,7 @@ impl Options {
|
||||
let user =
|
||||
register_user(&mut txn, &mut rng, &clock, hasher, username, password).await?;
|
||||
txn.commit().await?;
|
||||
info!(user.id = %user.data, %user.username, "User registered");
|
||||
info!(%user.id, %user.username, "User registered");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -217,7 +217,7 @@ impl Options {
|
||||
let user = lookup_user_by_username(&mut txn, username).await?;
|
||||
|
||||
set_password(&mut txn, &mut rng, &clock, hasher, &user, password).await?;
|
||||
info!(user.id = %user.data, %user.username, "Password changed");
|
||||
info!(%user.id, %user.username, "Password changed");
|
||||
txn.commit().await?;
|
||||
|
||||
Ok(())
|
||||
|
@ -16,6 +16,7 @@ use camino::Utf8PathBuf;
|
||||
use clap::Parser;
|
||||
use mas_storage::Clock;
|
||||
use mas_templates::Templates;
|
||||
use rand::SeedableRng;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
pub(super) struct Options {
|
||||
@ -38,9 +39,11 @@ impl Options {
|
||||
match &self.subcommand {
|
||||
SC::Check { path } => {
|
||||
let clock = Clock::default();
|
||||
// XXX: we should disallow SeedableRng::from_entropy
|
||||
let mut rng = rand_chacha::ChaChaRng::from_entropy();
|
||||
let url_builder = mas_router::UrlBuilder::new("https://example.com/".parse()?);
|
||||
let templates = Templates::load(path.clone(), url_builder).await?;
|
||||
templates.check_render(clock.now()).await?;
|
||||
templates.check_render(clock.now(), &mut rng).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user