Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some special characters are not recognized #147

Closed
Bbansjkl opened this issue Mar 10, 2019 · 3 comments
Closed

Some special characters are not recognized #147

Bbansjkl opened this issue Mar 10, 2019 · 3 comments
Labels
enhancement New feature or request PR WELCOME <3 Pull Requests are welcome with love <3

Comments

@Bbansjkl
Copy link

Bbansjkl commented Mar 10, 2019

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Windows 10 1803

Versions

No idea, used the demo page today, 2019-03-10 at around 13:00 UTC

Repro steps

Activate "Show Password Details"
Enter the special character §, ,\ or µ. There are probably a lot more that don't work, but those are the ones I tested.
Observe how "At least one special character" is still showing as unfulfilled.

The log given by the failure

-

Desired functionality

Recognize more special characters.

Mention any other details that might be useful

German Umlauts(äöüßÄÖÜẞ) are also not recognized as special character or lower- or uppercase letters.
The regular expression token \W matches all non-word characters and could be used to check for this.

@AnthonyNahas AnthonyNahas added enhancement New feature or request PR WELCOME <3 Pull Requests are welcome with love <3 labels Mar 12, 2019
@AnthonyNahas
Copy link
Member

@Bbansjkl I've just rleased v3.7.0 which supports custom regex validation e.g:

<mat-slide-toggle #toggle>Show Password Details</mat-slide-toggle>
      
 <mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color">
  <mat-label>Password</mat-label>
  <mat-pass-toggle-visibility #toggleVisbility matSuffix></mat-pass-toggle-visibility>
  <input matInput #password
         [type]="toggleVisbility.type"
         placeholder="Password">
  <mat-hint align="end" aria-live="polite">
    {{password.value.length}} / {{passwordComponent.max}}
  </mat-hint>
</mat-form-field>
 
        
<mat-password-strength #passwordComponent
  (onStrengthChanged)="onStrengthChanged($event)"
  [password]="password.value"
  [customValidator]="pattern">
</mat-password-strength>

<mat-password-strength-info
  *ngIf="toggle.checked"
  [passwordComponent]="passwordComponent6"
  customCharsCriteriaMsg="1 german special chars is required"
  [enableScoreInfo]="true">
</mat-password-strength-info>
pattern = new RegExp(/^(?=.*?[äöüÄÖÜß])/);

cheers 🍻

@pflzr
Copy link

pflzr commented Oct 18, 2019

@AnthonyNahas is there a way to add for example the "German Umlauts"-Chars to existing validators like the Upper- / Lower-Case-Validator? I think for a german user it is a little confusing that "öäüÖÄÜ" is not a valid "letter" for the upper-/lower-case validation.
Maybe it can be solved with a adjustable encoding?

@AnthonyNahas
Copy link
Member

@pflzr Can you provide a PR for that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR WELCOME <3 Pull Requests are welcome with love <3
Projects
None yet
Development

No branches or pull requests

3 participants