diff --git a/src/tera/admin/user.rs b/src/tera/admin/user.rs index 27109ce..012df89 100644 --- a/src/tera/admin/user.rs +++ b/src/tera/admin/user.rs @@ -226,10 +226,15 @@ async fn send_welcome_mail( } #[get("/user//reset-pw")] -async fn resetpw(db: &State, _admin: AdminUser, user: i32) -> Flash { +async fn resetpw(db: &State, admin: AdminUser, user: i32) -> Flash { let user = User::find_by_id(db, user).await; match user { Some(user) => { + Log::create( + db, + format!("{} has resetted the pw for {}", admin.user.name, user.name), + ) + .await; user.reset_pw(db).await; Flash::success( Redirect::to("/admin/user"),