How to use the @ngx-validate/core.validatePassword function in @ngx-validate/core

To help you get started, we’ve selected a few @ngx-validate/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abpframework / abp / npm / ng-packs / packages / identity / src / lib / components / users / users.component.ts View on Github external
phoneNumber: [this.selected.phoneNumber || '', [Validators.maxLength(16)]],
        lockoutEnabled: [this.selected.lockoutEnabled || (this.selected.id ? false : true)],
        twoFactorEnabled: [this.selected.twoFactorEnabled || (this.selected.id ? false : true)],
        roleNames: this.fb.array(
          this.roles.map(role =>
            this.fb.group({
              [role.name]: [
                !!snq(() => this.selectedUserRoles.find(userRole => userRole.id === role.id)),
              ],
            }),
          ),
        ),
      });

      const passwordValidators = [
        validatePassword(this.passwordRulesArr),
        Validators.minLength(this.requiredPasswordLength),
        Validators.maxLength(32),
      ];

      this.form.addControl('password', new FormControl('', [...passwordValidators]));

      if (!this.selected.userName) {
        this.form.get('password').setValidators([...passwordValidators, Validators.required]);
        this.form.get('password').updateValueAndValidity();
      }
    });
  }
github abpframework / abp / npm / ng-packs / dist / account / fesm5 / abp-ng.account.js View on Github external
}
        if ((passwordRules['Abp.Identity.Password.RequireLowercase'] || '').toLowerCase() === 'true') {
            passwordRulesArr.push('small');
        }
        if ((passwordRules['Abp.Identity.Password.RequireUppercase'] || '').toLowerCase() === 'true') {
            passwordRulesArr.push('capital');
        }
        if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) {
            passwordRulesArr.push('special');
        }
        if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
            requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
        }
        this.form = this.fb.group({
            username: ['', [required$1, maxLength$1(255)]],
            password: ['', [required$1, validatePassword(passwordRulesArr), minLength$1(requiredLength), maxLength$1(32)]],
            email: ['', [required$1, email]],
        });
    };
    /**
github abpframework / abp / npm / ng-packs / dist / account / esm2015 / lib / components / change-password / change-password.component.js View on Github external
passwordRulesArr.push('special');
        }
        if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
            requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
        }
        this.form = this.fb.group({
            password: ['', required],
            newPassword: [
                '',
                {
                    validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)],
                },
            ],
            repeatNewPassword: [
                '',
                { validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)] },
            ],
        }, {
            validators: [comparePasswords(PASSWORD_FIELDS)],
        });
    }
    /**
github abpframework / abp / npm / ng-packs / packages / account / src / lib / components / register / register.component.ts View on Github external
if ((passwordRules['Abp.Identity.Password.RequireUppercase'] || '').toLowerCase() === 'true') {
      passwordRulesArr.push('capital');
    }

    if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) {
      passwordRulesArr.push('special');
    }

    if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
      requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
    }

    this.form = this.fb.group({
      username: ['', [required, maxLength(255)]],
      password: ['', [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)]],
      email: ['', [required, email]],
    });
  }
github abpframework / abp / npm / ng-packs / dist / account / fesm2015 / abp-ng.account.js View on Github external
}
        if ((passwordRules['Abp.Identity.Password.RequireUppercase'] || '').toLowerCase() === 'true') {
            passwordRulesArr.push('capital');
        }
        if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) {
            passwordRulesArr.push('special');
        }
        if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
            requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
        }
        this.form = this.fb.group({
            password: ['', required$2],
            newPassword: [
                '',
                {
                    validators: [required$2, validatePassword(passwordRulesArr), minLength$2(requiredLength), maxLength$2(32)],
                },
            ],
            repeatNewPassword: [
                '',
                { validators: [required$2, validatePassword(passwordRulesArr), minLength$2(requiredLength), maxLength$2(32)] },
            ],
        }, {
            validators: [comparePasswords(PASSWORD_FIELDS)],
        });
    }
    /**
github abpframework / abp / npm / ng-packs / packages / account / src / lib / components / change-password / change-password.component.ts View on Github external
passwordRulesArr.push('special');
    }

    if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
      requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
    }

    this.form = this.fb.group(
      {
        password: ['', required],
        newPassword: [
          '',
          {
            validators: [
              required,
              validatePassword(passwordRulesArr),
              minLength(requiredLength),
              maxLength(32),
            ],
          },
        ],
        repeatNewPassword: [
          '',
          {
            validators: [
              required,
              validatePassword(passwordRulesArr),
              minLength(requiredLength),
              maxLength(32),
            ],
          },
        ],
github abpframework / abp / npm / ng-packs / dist / account / esm5 / lib / components / change-password / change-password.component.js View on Github external
}
        if ((passwordRules['Abp.Identity.Password.RequireUppercase'] || '').toLowerCase() === 'true') {
            passwordRulesArr.push('capital');
        }
        if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) {
            passwordRulesArr.push('special');
        }
        if (Number.isInteger(+passwordRules['Abp.Identity.Password.RequiredLength'])) {
            requiredLength = +passwordRules['Abp.Identity.Password.RequiredLength'];
        }
        this.form = this.fb.group({
            password: ['', required],
            newPassword: [
                '',
                {
                    validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)],
                },
            ],
            repeatNewPassword: [
                '',
                { validators: [required, validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(32)] },
            ],
        }, {
            validators: [comparePasswords(PASSWORD_FIELDS)],
        });
    };
    /**

@ngx-validate/core

<p align="center"> <img src="https://github.com/ng-turkey/ngx-validate/workflows/Lint%20&%20Test%20&%20Build/badge.svg"/> <a href="https://codeclimate.com/github/ng-turkey/ngx-validate/maintainability"><img src="https://api.codeclimate.com/v1/badges/1

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages