From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Folke Gleumes <f.gleumes@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] acme: ui: handle missing meta field in directory response
Date: Mon, 22 Apr 2024 11:06:56 +0200 [thread overview]
Message-ID: <20240422110656.046781ce@rosa.proxmox.com> (raw)
In-Reply-To: <20240422090101.141532-1-f.gleumes@proxmox.com>
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 <s.ivanov@proxmox.com>
On Mon, 22 Apr 2024 11:01:02 +0200
Folke Gleumes <f.gleumes@proxmox.com> 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 <f.gleumes@proxmox.com>
> ---
> 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
next prev parent reply other threads:[~2024-04-22 9:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 9:01 Folke Gleumes
2024-04-22 9:06 ` Stoiko Ivanov [this message]
2024-04-22 9:08 ` Folke Gleumes
2024-04-22 10:39 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240422110656.046781ce@rosa.proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=f.gleumes@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox