From 2dbc1a9a55886750f60ff329a389c0aabe98f893 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 1 Feb 2021 11:48:33 +0100 Subject: [PATCH] ui: tfa: improve button text for webAuthn So users now what to press for starting off a webauthn challenge. Signed-off-by: Thomas Lamprecht --- www/LoginView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/LoginView.js b/www/LoginView.js index 3f775cd0..4d26d2d6 100644 --- a/www/LoginView.js +++ b/www/LoginView.js @@ -254,6 +254,7 @@ Ext.define('PBS.login.TfaWindow', { viewModel: { data: { + confirmText: gettext('Confirm Second Factor'), canConfirm: false, availabelChallenge: {}, }, @@ -324,6 +325,10 @@ Ext.define('PBS.login.TfaWindow', { newField.focus(); newField.validate(); } + + let confirmText = newCard.confirmText || gettext('Confirm Second Factor'); + this.getViewModel().set('confirmText', confirmText); + this.saveLastTabUsed(tabPanel, newCard); }, }, @@ -483,6 +488,7 @@ Ext.define('PBS.login.TfaWindow', { xtype: 'panel', title: 'WebAuthn', iconCls: 'fa fa-fw fa-shield', + confirmText: gettext('Start WebAuthn challenge'), handler: 'loginWebauthn', bind: { disabled: '{!availabelChallenge.webauthn}', @@ -567,11 +573,11 @@ Ext.define('PBS.login.TfaWindow', { buttons: [ { - text: gettext('Confirm Second Factor'), handler: 'loginTFA', reference: 'tfaButton', disabled: true, bind: { + text: '{confirmText}', disabled: '{!canConfirm}', }, },