ensure log creation for all present action

This commit is contained in:
2026-04-03 16:05:53 +02:00
parent 20efa90e5d
commit e4cccde466
4 changed files with 37 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ use serde::Deserialize;
use crate::{
api::CompositeError,
logs::{LogAction, LogEntry},
users::{
User,
auth::{AuthError, UserAuthRequired, UserAuthenticate},
@@ -75,5 +76,12 @@ pub async fn create_user(
}
let mut nu = User::create(form.handle)?;
nu.set_password(Some(&form.password))?;
LogEntry::new(
u,
LogAction::CreateUser {
id: nu.id,
handle: nu.handle.as_str().to_string(),
},
)?;
Ok(Redirect::to("/users").into_response())
}