Browse Source

refactor(account): add maxLength to change password fields

resolves #2039
pull/2041/head
mehmet-erim 7 years ago
parent
commit
f34ef20bcd
  1. 2
      npm/ng-packs/package.json
  2. 6
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

2
npm/ng-packs/package.json

@ -5,7 +5,7 @@
"test": "ng test",
"symlink": "symlink",
"abpng": "abpng",
"commit": "git-cz && node scripts/push.js",
"commit": "git-cz",
"lint": "ng lint --fix",
"scripts:build": "cd scripts && npm install && npm run build"
},

6
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

@ -7,7 +7,7 @@ import { Store } from '@ngxs/store';
import snq from 'snq';
import { finalize } from 'rxjs/operators';
const { minLength, required } = Validators;
const { minLength, required, maxLength } = Validators;
const PASSWORD_FIELDS = ['newPassword', 'repeatNewPassword'];
@ -61,12 +61,12 @@ export class ChangePasswordComponent implements OnInit {
newPassword: [
'',
{
validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength)],
validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)],
},
],
repeatNewPassword: [
'',
{ validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength)] },
{ validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)] },
],
},
{

Loading…
Cancel
Save