Improved logging, UI tweaks.

This commit is contained in:
2024-02-23 14:00:31 +01:00
parent 2119c2e56b
commit 676951e809
12 changed files with 64 additions and 13 deletions
+5
View File
@@ -134,6 +134,8 @@ pub async fn logout() -> Result<(), ServerFnError> {
let session = extract::<Session>().await?;
session.clear();
info!("User logged out");
redirect("/login");
Ok(())
}
@@ -150,6 +152,7 @@ pub async fn admin_check() -> Result<bool, ServerFnError> {
#[server]
pub async fn get_user() -> Result<Option<User>, ServerFnError> {
info!("Get user");
Ok(logged_in_user().await)
}
@@ -231,6 +234,8 @@ pub async fn change_pwd(new_pw: PwdChange) -> Result<ApiResponse<()>, ServerFnEr
.execute(&pool)
.await?;
info!("Password changed for user: {}", new_pw.login());
Ok(ApiResponse::Data(()))
}