perf: Reset password: optimize form frame

pull/13949/head
feng 2024-08-12 15:13:24 +08:00 committed by Bryan
parent 8e6aa4524d
commit 3b9bcc719e
1 changed files with 7 additions and 2 deletions

View File

@ -99,8 +99,13 @@ $(document).ready(function () {
$(this).append(hiddenPasswordField, hiddenConfirmPasswordField);
idPassword.remove();
idConfirmPassword.remove();
// Get the length of the original password
var passwordLength = idPassword.val().length;
var confirmPasswordLength = idConfirmPassword.val().length;
// Replace the original password fields with asterisks of the same length
idPassword.val('*'.repeat(passwordLength));
idConfirmPassword.val('*'.repeat(confirmPasswordLength));
this.submit();
});