From 3b9bcc719e03bccd992cb75dc214348cc3e881bb Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Mon, 12 Aug 2024 15:13:24 +0800 Subject: [PATCH] perf: Reset password: optimize form frame --- apps/users/templates/users/reset_password.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/users/templates/users/reset_password.html b/apps/users/templates/users/reset_password.html index 9131e7d82..bf45e04cf 100644 --- a/apps/users/templates/users/reset_password.html +++ b/apps/users/templates/users/reset_password.html @@ -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(); });