store.findRecord returns the first match, and by default
matches the beginning of the strings not the whole

without this, with multple realms with the same name, but different
tfa settings, the login window can show the tfa input box even
when the selected realm has no tfa active

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 www/manager6/form/RealmComboBox.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/RealmComboBox.js 
b/www/manager6/form/RealmComboBox.js
index 8ce767c..4d9e5aa 100644
--- a/www/manager6/form/RealmComboBox.js
+++ b/www/manager6/form/RealmComboBox.js
@@ -26,7 +26,8 @@ Ext.define('PVE.form.RealmComboBox', {
 
     needOTP: function(realm) {
        var me = this;
-       var rec = me.store.findRecord('realm', realm);
+       // use exact match
+       var rec = me.store.findRecord('realm', realm, 0, false, false, true);
        return rec && rec.data && rec.data.tfa ? rec.data.tfa : undefined;
     },
 
-- 
2.1.4


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to