[pbs-devel] [PATCH proxmox-backup v2 4/4] ui: LoginView: show webauthn errors in window

Dominik Csapak d.csapak at proxmox.com
Thu Feb 25 10:01:22 CET 2021


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

Signed-off-by: Dominik Csapak <d.csapak at 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






More information about the pbs-devel mailing list