all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 4/4] ui: LoginView: show webauthn errors in window
Date: Thu, 25 Feb 2021 10:01:22 +0100	[thread overview]
Message-ID: <20210225090122.1094-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210225090122.1094-1-d.csapak@proxmox.com>

instead of silently discarding the error, else the user might be
confused because nothing happened

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/LoginView.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/www/LoginView.js b/www/LoginView.js
index 1c7a977c..6dd09646 100644
--- a/www/LoginView.js
+++ b/www/LoginView.js
@@ -383,6 +383,7 @@ Ext.define('PBS.login.TfaWindow', {
 	    let view = me.getView();
 
 	    me.lookup('webAuthnWaiting').setVisible(true);
+	    me.lookup('webAuthnError').setVisible(false);
 
 	    let challenge = view.challenge.webauthn;
 
@@ -409,6 +410,10 @@ Ext.define('PBS.login.TfaWindow', {
 		// checking for error.code === DOMException.ABORT_ERR only works in firefox -.-
 		this.getViewModel().set('canConfirm', true);
 		// FIXME: better handling, show some message, ...?
+		me.lookup('webAuthnError').setData({
+		    error: Ext.htmlEncode(error.toString()),
+		});
+		me.lookup('webAuthnError').setVisible(true);
 		return;
 	    } finally {
 		let waitingMessage = me.lookup('webAuthnWaiting');
@@ -505,6 +510,15 @@ Ext.define('PBS.login.TfaWindow', {
 			reference: 'webAuthnWaiting',
 			hidden: true,
 		    },
+		    {
+			xtype: 'box',
+			data: {
+			    error: '',
+			},
+			tpl: '<i class="fa fa-warning warning"></i> {error}',
+			reference: 'webAuthnError',
+			hidden: true,
+		    },
 		],
 	    },
 	    {
-- 
2.20.1





  parent reply	other threads:[~2021-02-25  9:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  9:01 [pbs-devel] [PATCH proxmox-backup v2 0/4] improving webauthn handling Dominik Csapak
2021-02-25  9:01 ` [pbs-devel] [PATCH proxmox-backup v2 1/4] config/tfa: set UserVerificationPolicy to Discouraged Dominik Csapak
2021-02-25  9:01 ` [pbs-devel] [PATCH proxmox-backup v2 2/4] Revert "ui: window/Settings / WebAuthn: add browser setting for userVerificationo" Dominik Csapak
2021-02-25  9:01 ` [pbs-devel] [PATCH proxmox-backup v2 3/4] config/tfa: webauthn: disallow registering a token twice Dominik Csapak
2021-02-25  9:01 ` Dominik Csapak [this message]
2021-03-03 13:05 ` [pbs-devel] applied-series: [PATCH proxmox-backup v2 0/4] improving webauthn handling 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=20210225090122.1094-5-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal