ui: tfa: improve button text for webAuthn

So users now what to press for starting off a webauthn challenge.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-02-01 11:48:33 +01:00
parent dceecb0bbf
commit 2dbc1a9a55

View File

@ -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}',
},
},