diff --git a/src/main/webapp/assets/js/web/forgotChangePasswordHandler.js b/src/main/webapp/assets/js/web/forgotChangePasswordHandler.js index 807ee15a..c346ac0d 100644 --- a/src/main/webapp/assets/js/web/forgotChangePasswordHandler.js +++ b/src/main/webapp/assets/js/web/forgotChangePasswordHandler.js @@ -45,7 +45,7 @@ if (changePasswordForm) { }); } }, - error: function (xhr, status, error) { + error: function () { Swal.fire({ title: "Lỗi!", text: "Đã xảy ra lỗi trong quá trình xử lý yêu cầu. Vui lòng thử lại!", @@ -56,50 +56,50 @@ if (changePasswordForm) { }); - passwordInput.addEventListener('input', function () { - removeSpaces(passwordInput); - }); + $(".toggle-password").click(function () { + $(this).toggleClass("fa-eye fa-eye-slash"); + input = $(this).parent().find("input"); - confirmPasswordInput.addEventListener('input', function () { - removeSpaces(confirmPasswordInput); + if (input.attr("type") == "password") { + input.attr("type", "text"); + } else { + input.attr("type", "password"); + } }); +} - function removeSpaces(input) { - input.value = input.value.replace(/\s/g, ''); - } +passwordInput.addEventListener('input', function () { + removeSpaces(passwordInput); +}); - function isPasswordMatch(password, confirmPassword) { - return password === confirmPassword; - } +confirmPasswordInput.addEventListener('input', function () { + removeSpaces(confirmPasswordInput); +}); - function isStrongPassword(password) { - if (password.length < 6) { - return false; - } +function removeSpaces(input) { + input.value = input.value.replace(/\s/g, ''); +} - if (!/\d/.test(password)) { - return false; - } +function isPasswordMatch(password, confirmPassword) { + return password === confirmPassword; +} - if (!/[!@#$%^&*()_+{}\[\]:;<>,.?~\\/-]/.test(password)) { - return false; - } +function isStrongPassword(password) { + if (password.length < 6) { + return false; + } - if (!/[A-Z]/.test(password)) { - return false; - } + if (!/\d/.test(password)) { + return false; + } - return true; + if (!/[!@#$%^&*()_+{}\[\]:;<>,.?~\\/-]/.test(password)) { + return false; } - $(".toggle-password").click(function () { - $(this).toggleClass("fa-eye fa-eye-slash"); - input = $(this).parent().find("input"); + if (!/[A-Z]/.test(password)) { + return false; + } - if (input.attr("type") == "password") { - input.attr("type", "text"); - } else { - input.attr("type", "password"); - } - }); + return true; } diff --git a/src/main/webapp/assets/js/web/forgotPasswordHandler.js b/src/main/webapp/assets/js/web/forgotPasswordHandler.js index 1222e171..0cddab53 100644 --- a/src/main/webapp/assets/js/web/forgotPasswordHandler.js +++ b/src/main/webapp/assets/js/web/forgotPasswordHandler.js @@ -21,12 +21,12 @@ if (forgotForm) { emailInput.addEventListener('input', function () { removeSpaces(emailInput); }); +} - function removeSpaces(input) { - input.value = input.value.replace(/\s/g, ''); - } +function removeSpaces(input) { + input.value = input.value.replace(/\s/g, ''); +} - function isValidEmail(email) { - return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); - } +function isValidEmail(email) { + return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); } \ No newline at end of file