[yew-devel] [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms

Shannon Sterz s.sterz at proxmox.com
Thu Oct 2 16:35:32 CEST 2025


previously trying to remove a realm failed because the base_url to
query realms is not the same for removing a realm. the later depends
on the type of the realm, so query the type to get the appropriate
url.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6885
Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 src/auth_view.rs | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/auth_view.rs b/src/auth_view.rs
index f957e65..aac08e0 100644
--- a/src/auth_view.rs
+++ b/src/auth_view.rs
@@ -203,13 +203,22 @@ impl LoadableComponent for ProxmoxAuthView {
         match msg {
             Msg::Redraw => true,
             Msg::Remove => {
-                let info = match self.get_selected_record() {
-                    Some(info) => info,
-                    None => return true,
+                let Some(info) = self.get_selected_record() else {
+                    return true;
+                };
+
+                let base_url = match info.ty.as_str() {
+                    "openid" => &props.openid_base_url,
+                    "ldap" => &props.ldap_base_url,
+                    "ad" => &props.ad_base_url,
+                    _ => return true,
+                };
+
+                let Some(base_url) = base_url.clone() else {
+                    return true;
                 };
 
                 let link = ctx.link();
-                let base_url = props.base_url.clone();
                 link.clone().spawn(async move {
                     if let Err(err) = delete_item(base_url, info.realm.into()).await {
                         link.show_error(tr!("Unable to delete item"), err, true);
-- 
2.47.3





More information about the yew-devel mailing list