From 5c48d0af1fc5079374637c51273b33e61ad17fc0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 10 Dec 2020 13:43:09 +0100 Subject: [PATCH] tfa gui: fix adding recovery keys as user Signed-off-by: Wolfgang Bumiller --- www/window/AddTfaRecovery.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/window/AddTfaRecovery.js b/www/window/AddTfaRecovery.js index df94884b..1dc81f86 100644 --- a/www/window/AddTfaRecovery.js +++ b/www/window/AddTfaRecovery.js @@ -81,13 +81,19 @@ Ext.define('PBS.window.AddTfaRecovery', { throw "no userid set"; } + let params = { type: 'recovery' }; + + if (Proxmox.UserName !== 'root@pam') { + params.password = me.lookup('password').getValue(); + } + me.getView().close(); try { let response = await PBS.Async.api2({ url: `${baseurl}/${userid}`, method: 'POST', - params: { type: 'recovery' }, + params, }); let values = response.result.data.recovery.join("\n"); Ext.create('PBS.window.TfaRecoveryShow', {