From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 66F811FF17E for ; Thu, 2 Oct 2025 16:35:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 89CD112FE7; Thu, 2 Oct 2025 16:35:47 +0200 (CEST) From: Shannon Sterz To: yew-devel@lists.proxmox.com Date: Thu, 2 Oct 2025 16:35:32 +0200 Message-ID: <20251002143532.286752-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759415720604 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.057 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" 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 --- 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 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel