[pdm-devel] [PATCH yew-comp v2 2/2] http_helpers: reload LocalAclTree when logging in or refreshing a ticket

Shannon Sterz s.sterz at proxmox.com
Wed Oct 22 15:11:22 CEST 2025


so the ui renders ui elements appropriatelly for a newly authenticated
user or if the user's permissions have changed since the last ticket
refresh.

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 src/http_helpers.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/http_helpers.rs b/src/http_helpers.rs
index 94cc078..ed6671f 100644
--- a/src/http_helpers.rs
+++ b/src/http_helpers.rs
@@ -15,6 +15,7 @@ use proxmox_client::HttpApiClient;
 use proxmox_login::{ticket::Validity, Authentication, TicketResult};
 use yew::Callback;
 
+use crate::acl_context::LocalAclTree;
 use crate::{json_object_to_query, ExistingProduct, HttpClientWasm, ProjectInfo};
 
 static LAST_NOTIFY_EPOCH: AtomicU32 = AtomicU32::new(0);
@@ -129,6 +130,7 @@ async fn ticket_refresh_loop() {
                         Ok(TicketResult::Full(auth)) | Ok(TicketResult::HttpOnly(auth)) => {
                             log::info!("ticket_refresh_loop: Got ticket update.");
                             client.set_auth(auth.clone());
+                            LocalAclTree::load().await;
                         }
                         _ => { /* do nothing */ }
                     }
@@ -189,11 +191,13 @@ pub async fn http_login(
         TicketResult::Full(auth) => {
             client.set_auth(auth.clone());
             update_global_client(client);
+            LocalAclTree::load().await;
             Ok(TicketResult::Full(auth))
         }
         TicketResult::HttpOnly(auth) => {
             client.set_auth(auth.clone());
             update_global_client(client);
+            LocalAclTree::load().await;
             Ok(TicketResult::HttpOnly(auth))
         }
         challenge => Ok(challenge),
@@ -209,6 +213,7 @@ pub async fn http_login_tfa(
     let auth = client.login_tfa(challenge, request).await?;
     client.set_auth(auth.clone());
     update_global_client(client);
+    LocalAclTree::load().await;
     Ok(auth)
 }
 
-- 
2.47.3





More information about the pdm-devel mailing list