ui: tfa: handle if TFA setup with no specific type set

if we have no info about TFA in the userview (x as key instead of
x!oath or x!u2f) we disabled the whole window and the only action
was to delete

instead show all options, so the user can overwrite the setting

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-04-17 14:28:22 +02:00 committed by Thomas Lamprecht
parent df7587c99c
commit 920d4deb05

View File

@ -110,11 +110,11 @@ Ext.define('PVE.window.TFAEdit', {
},
canSetupTOTP: function(get) {
var tfa = get('tfa_type');
return (tfa === undefined || tfa === 'totp');
return (tfa === undefined || tfa === 'totp' || tfa === 1);
},
canSetupU2F: function(get) {
var tfa = get('tfa_type');
return (get('u2f_available') && (tfa === undefined || tfa === 'u2f'));
return (get('u2f_available') && (tfa === undefined || tfa === 'u2f' || tfa === 1));
}
}
},