From 2ba64bed18ce4701c711340e8e4ad2715c6f0c8b Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 3 Feb 2021 10:21:56 +0100 Subject: [PATCH] ui: tfa: fix emptyText for password One needs to enter their password, not the one from the user one adds/deletes TFA. Signed-off-by: Thomas Lamprecht --- www/config/TfaView.js | 4 ++-- www/window/AddTfaRecovery.js | 11 ++--------- www/window/AddTotp.js | 9 ++------- www/window/AddWebauthn.js | 11 ++--------- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/www/config/TfaView.js b/www/config/TfaView.js index 24d90b6f..26f0e7b2 100644 --- a/www/config/TfaView.js +++ b/www/config/TfaView.js @@ -394,8 +394,8 @@ Ext.define('PBS.tfa.confirmRemove', { validateBlank: true, padding: '10 0 0 0', cbind: { - emptyText: get => - Ext.String.format(gettext("Confirm password of '{0}'"), get('userid')), + emptyText: () => + Ext.String.format(gettext("Confirm your ({0}) password"), Proxmox.UserName), }, }, ], diff --git a/www/window/AddTfaRecovery.js b/www/window/AddTfaRecovery.js index 3b4d286b..381ffb5b 100644 --- a/www/window/AddTfaRecovery.js +++ b/www/window/AddTfaRecovery.js @@ -42,12 +42,6 @@ Ext.define('PBS.window.AddTfaRecovery', { has_entry: false, userid: null, }, - formulas: { - passwordConfirmText: (get) => { - let id = get('userid'); - return Ext.String.format(gettext("Confirm password of '{0}'"), id); - }, - }, }, controller: { @@ -130,9 +124,8 @@ Ext.define('PBS.window.AddTfaRecovery', { cbind: { hidden: () => Proxmox.UserName === 'root@pam', disabled: () => Proxmox.UserName === 'root@pam', - }, - bind: { - emptyText: '{passwordConfirmText}', + emptyText: () => + Ext.String.format(gettext("Confirm your ({0}) password"), Proxmox.UserName), }, }, ], diff --git a/www/window/AddTotp.js b/www/window/AddTotp.js index 5866deb7..3e834c34 100644 --- a/www/window/AddTotp.js +++ b/www/window/AddTotp.js @@ -57,10 +57,6 @@ Ext.define('PBS.window.AddTotp', { secretEmpty: function(get) { return get('secret').length === 0; }, - passwordConfirmText: (get) => { - let id = get('userid'); - return Ext.String.format(gettext("Confirm password of '{0}'"), id); - }, }, }, @@ -257,9 +253,8 @@ Ext.define('PBS.window.AddTotp', { cbind: { hidden: () => Proxmox.UserName === 'root@pam', disabled: () => Proxmox.UserName === 'root@pam', - }, - bind: { - emptyText: '{passwordConfirmText}', + emptyText: () => + Ext.String.format(gettext("Confirm your ({0}) password"), Proxmox.UserName), }, }, ], diff --git a/www/window/AddWebauthn.js b/www/window/AddWebauthn.js index 3fb5a01d..16731a63 100644 --- a/www/window/AddWebauthn.js +++ b/www/window/AddWebauthn.js @@ -24,12 +24,6 @@ Ext.define('PBS.window.AddWebauthn', { valid: false, userid: null, }, - formulas: { - passwordConfirmText: (get) => { - let id = get('userid'); - return Ext.String.format(gettext("Confirm password of '{0}'"), id); - }, - }, }, controller: { @@ -188,9 +182,8 @@ Ext.define('PBS.window.AddWebauthn', { cbind: { hidden: () => Proxmox.UserName === 'root@pam', disabled: () => Proxmox.UserName === 'root@pam', - }, - bind: { - emptyText: '{passwordConfirmText}', + emptyText: () => + Ext.String.format(gettext("Confirm your ({0}) password"), Proxmox.UserName), }, }, ],