[pve-devel] [PATCH widget-toolkit 2/3] password edit: add a minimum length parameter

Shannon Sterz s.sterz at proxmox.com
Fri Oct 4 15:32:04 CEST 2024


so products can independently specify the minimum length of new
passwords

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 src/window/PasswordEdit.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/window/PasswordEdit.js b/src/window/PasswordEdit.js
index bc54b8d..e012a0d 100644
--- a/src/window/PasswordEdit.js
+++ b/src/window/PasswordEdit.js
@@ -12,6 +12,10 @@ Ext.define('Proxmox.window.PasswordEdit', {
 	labelWidth: 150,
     },
 
+    // specifies the minimum length of *new* passwords so this can be
+    // adapted by each product as limits are changed there.
+    minLength: 5,
+
     // allow products to opt-in as their API gains support for this.
     confirmCurrentPassword: false,
 
@@ -33,13 +37,15 @@ Ext.define('Proxmox.window.PasswordEdit', {
 	    xtype: 'textfield',
 	    inputType: 'password',
 	    fieldLabel: gettext('New Password'),
-	    minLength: 5,
 	    allowBlank: false,
 	    name: 'password',
 	    listeners: {
 		change: (field) => field.next().validate(),
 		blur: (field) => field.next().validate(),
 	    },
+	    cbind: {
+		minLength: '{minLength}',
+	    },
 	},
 	{
 	    xtype: 'textfield',
-- 
2.39.5





More information about the pve-devel mailing list