mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-15 10:25:11 +00:00
fix: add hint for password-confirmation (#1863)
* fix:add hint for password-confirmation * Update internal/ui/login/static/i18n/de.yaml Co-authored-by: Fabi <[email protected]> Co-authored-by: Fabi <[email protected]>
This commit is contained in:
@@ -3,7 +3,7 @@ function CheckChangePwPolicy() {
|
||||
let pwNew = policyElement.value;
|
||||
let pwNewConfirmation = document.getElementById("change-password-confirmation").value;
|
||||
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew) === false) {
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew, pwNewConfirmation) === false) {
|
||||
policyElement.setAttribute("color", "warn");
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@ function CheckInitPwPolicy() {
|
||||
let pwNew = policyElement.value;
|
||||
let pwNewConfirmation = document.getElementById("passwordconfirm").value;
|
||||
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew) === false) {
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew, pwNewConfirmation) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function ComplexityPolicyCheck(policyElement, pwNew) {
|
||||
function ComplexityPolicyCheck(policyElement, pwNew, pwNewConfirmation) {
|
||||
let minLength = policyElement.dataset.minlength;
|
||||
let upperRegex = policyElement.dataset.hasUppercase;
|
||||
let lowerRegex = policyElement.dataset.hasLowercase;
|
||||
@@ -55,6 +55,14 @@ function ComplexityPolicyCheck(policyElement, pwNew) {
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
let confirmation = document.getElementById('confirmation');
|
||||
if (pwNew === pwNewConfirmation && pwNewConfirmation !== "" ) {
|
||||
ValidPolicy(confirmation);
|
||||
valid = true;
|
||||
} else {
|
||||
InvalidPolicy(confirmation);
|
||||
valid = false;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ function CheckRegisterPwPolicy() {
|
||||
let pwNew = policyElement.value;
|
||||
let pwNewConfirmation = document.getElementById("register-password-confirmation").value;
|
||||
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew) === false) {
|
||||
if (ComplexityPolicyCheck(policyElement, pwNew, pwNewConfirmation) === false) {
|
||||
policyElement.setAttribute("color", "warn");
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user