|
|
|
|
@ -83,13 +83,13 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
text: this.ts.trPK('login', 'repeating-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isContainSpecialChar = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: this.ts.trPK('login', 'special-character-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
// public isContainSpecialChar = {
|
|
|
|
|
// blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
// greenImg: '../assets/icon/green.svg',
|
|
|
|
|
// redImg: '../assets/imgs/close.svg',
|
|
|
|
|
// text: this.ts.trPK('login', 'special-character-password-validation'),
|
|
|
|
|
// isMatch: false
|
|
|
|
|
// };
|
|
|
|
|
public confirmMatchNew = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
@ -176,8 +176,10 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.checkUserResult = result;
|
|
|
|
|
console.log(result);
|
|
|
|
|
this.cs.toastPK("changePassword", "successChange");
|
|
|
|
|
this.cs.greenToastPK("changePassword", "successChange");
|
|
|
|
|
this.sharedData.setSharedData(false, Password.IS_EXPIRED_PSW);
|
|
|
|
|
// this.cs.sharedService.getSharedData( AuthenticationService.IMEI_USER_DATA);
|
|
|
|
|
localStorage.setItem('password', this.P_NEW_PASSWORD);
|
|
|
|
|
this.cs.openLogin();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -198,8 +200,10 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.checkUserResult = result;
|
|
|
|
|
localStorage.setItem('password', this.P_NEW_PASSWORD);
|
|
|
|
|
console.log(result);
|
|
|
|
|
this.cs.toastPK("changePassword", "successChange");
|
|
|
|
|
this.cs.greenToastPK("changePassword", "successChange");
|
|
|
|
|
localStorage.setItem('password', this.P_NEW_PASSWORD);
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -254,8 +258,8 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
return this.isMinLength.blankImg;
|
|
|
|
|
case 5:
|
|
|
|
|
return this.isRepeatedLetter.blankImg;
|
|
|
|
|
case 6:
|
|
|
|
|
return this.isContainSpecialChar.blankImg;
|
|
|
|
|
// case 6:
|
|
|
|
|
// return this.isContainSpecialChar.blankImg;
|
|
|
|
|
case 7:
|
|
|
|
|
return this.confirmMatchNew.blankImg;
|
|
|
|
|
case 8:
|
|
|
|
|
@ -311,14 +315,14 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
this.isRepeatedLetter.isMatch = true;
|
|
|
|
|
return this.isRepeatedLetter.greenImg;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isContainSpecialChar.isMatch = true;
|
|
|
|
|
return this.isContainSpecialChar.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isContainSpecialChar.isMatch = false;
|
|
|
|
|
return this.isContainSpecialChar.redImg;
|
|
|
|
|
}
|
|
|
|
|
// case 6:
|
|
|
|
|
// if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
// this.isContainSpecialChar.isMatch = true;
|
|
|
|
|
// return this.isContainSpecialChar.greenImg;
|
|
|
|
|
// } else {
|
|
|
|
|
// this.isContainSpecialChar.isMatch = false;
|
|
|
|
|
// return this.isContainSpecialChar.redImg;
|
|
|
|
|
// }
|
|
|
|
|
case 7:
|
|
|
|
|
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
|
|
|
|
|
this.confirmMatchNew.isMatch = false;
|
|
|
|
|
@ -343,7 +347,7 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
disabledSubmitBtn() {
|
|
|
|
|
if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
|
|
|
|
|
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD
|
|
|
|
|
&& this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) {
|
|
|
|
|
&& this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.confirmMatchNew.isMatch) {
|
|
|
|
|
return false;
|
|
|
|
|
} else { return true; }
|
|
|
|
|
}
|
|
|
|
|
|