From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id F37321FF56B for ; Mon, 22 Apr 2024 11:07:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9958AC984; Mon, 22 Apr 2024 11:07:32 +0200 (CEST) Date: Mon, 22 Apr 2024 11:06:56 +0200 From: Stoiko Ivanov To: Folke Gleumes Message-ID: <20240422110656.046781ce@rosa.proxmox.com> In-Reply-To: <20240422090101.141532-1-f.gleumes@proxmox.com> References: <20240422090101.141532-1-f.gleumes@proxmox.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.076 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: Re: [pve-devel] [PATCH manager] acme: ui: handle missing meta field in directory response X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Gave this patch a spin against a quickly setup step-ca container I had lying around - the issue of not being able to register an account without EAB is gone with it. Tested-by: Stoiko Ivanov On Mon, 22 Apr 2024 11:01:02 +0200 Folke Gleumes wrote: > When none of the meta fields is set by the directory, the whole > dictionary is missing from the response, leading to an exception > when testing for fields inside it. > > Signed-off-by: Folke Gleumes > --- > www/manager6/node/ACME.js | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js > index a0db51a6..7fe49171 100644 > --- a/www/manager6/node/ACME.js > +++ b/www/manager6/node/ACME.js > @@ -150,15 +150,18 @@ Ext.define('PVE.node.ACMEAccountCreate', { > directory: value, > }, > success: function(response, opt) { > - if (response.result.data.termsOfService) { > + if (response.result.data && response.result.data.termsOfService) { > field.setValue(response.result.data.termsOfService); > disp.setValue(response.result.data.termsOfService); > checkbox.setHidden(false); > } else { > - checkbox.setValue(false); > + // Needed to pass input verification and enable register button > + // has no influence on the submitted form > + checkbox.setValue(true); > disp.setValue("No terms of service agreement required"); > } > - vm.set('eabRequired', !!response.result.data.externalAccountRequired); > + vm.set('eabRequired', !!(response.result.data && > + response.result.data.externalAccountRequired)); > }, > failure: function(response, opt) { > disp.setValue(undefined); _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel