Added user password validation, Fixed new user localization issue

This commit is contained in:
2025-10-26 21:31:29 +01:00
parent 97592fd9e8
commit b9b3c91f3f
4 changed files with 30 additions and 6 deletions

View File

@@ -187,4 +187,11 @@ async function loadUsersIntoSelect(selectElement, selectedValue = null) {
console.error('Error loading users:', err);
showToast(appTranslations.errorLoadingUsers, 'danger');
}
}
function validatePassword(password) {
// Regex: min 8 chars, one uppercase, one lowercase, one number, one special char
const strongPasswordRegex =
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_\-+=\[{\]};:'",<.>/?\\|`~]).{8,}$/;
return strongPasswordRegex.test(password);
}