Improved logging, UI tweaks.
This commit is contained in:
@@ -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(()))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user