mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-11 18:38:14 +01:00
Merge pull request #20 from steven-zou/fix/issue_1897
fix issue 1897: password validation enhancement
This commit is contained in:
commit
05777ea3cf
@ -65,10 +65,13 @@ export class PasswordSettingComponent implements AfterViewChecked {
|
||||
let cont = this.pwdForm.controls[key];
|
||||
if (cont) {
|
||||
this.validationStateMap[key] = cont.valid;
|
||||
if (key === "reNewPassword" && cont.valid) {
|
||||
let compareCont = this.pwdForm.controls["newPassword"];
|
||||
if (compareCont) {
|
||||
this.validationStateMap[key] = cont.value === compareCont.value;
|
||||
if (cont.valid) {
|
||||
if (key === "reNewPassword" || key === "newPassword") {
|
||||
let cpKey = key === "reNewPassword" ? "newPassword" : "reNewPassword";
|
||||
let compareCont = this.pwdForm.controls[cpKey];
|
||||
if (compareCont && compareCont.valid) {
|
||||
this.validationStateMap["reNewPassword"] = cont.value === compareCont.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export class ResetPasswordComponent implements OnInit {
|
||||
}
|
||||
|
||||
public close(): void {
|
||||
//If already reset password ok, navigator to sign-in
|
||||
//If already reset password ok, navigator to sign-in
|
||||
if (this.resetOk) {
|
||||
this.router.navigateByUrl(CommonRoutes.EMBEDDED_SIGN_IN);
|
||||
}
|
||||
@ -114,7 +114,10 @@ export class ResetPasswordComponent implements OnInit {
|
||||
this.validationState[key] = true;
|
||||
}
|
||||
} else {
|
||||
this.validationState[key] = this.getControlValidationState(key)
|
||||
this.validationState[key] = this.getControlValidationState(key);
|
||||
if (this.validationState[key]) {
|
||||
this.validationState["reNewPassword"] = this.samePassword();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,10 +142,11 @@ export class NewUserFormComponent implements AfterViewChecked, OnInit {
|
||||
}
|
||||
|
||||
//Check password confirmation
|
||||
if (key === "confirmPassword") {
|
||||
let peerCont = this.newUserForm.controls["newPassword"];
|
||||
if (peerCont) {
|
||||
this.validationStateMap[key] = cont.value === peerCont.value;
|
||||
if (key === "confirmPassword" || key === "newPassword") {
|
||||
let cpKey = key === "confirmPassword" ? "newPassword" : "confirmPassword";
|
||||
let peerCont = this.newUserForm.controls[cpKey];
|
||||
if (peerCont && peerCont.valid) {
|
||||
this.validationStateMap["confirmPassword"] = cont.value === peerCont.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user