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

More Secure Password Criteria (fixes #6768) #7846

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/login/login-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export class LoginFormComponent {
Validators.pattern(/^([^\x00-\x7F]|[A-Za-z0-9_.-])*$/i) ],
ac => this.validatorService.isUnique$('_users', 'name', ac, { errorType: 'duplicateUser' })
];
registerForm.password = [ '', Validators.compose([
Validators.required,
CustomValidators.spaceValidator,
CustomValidators.matchPassword('repeatPassword', false),
CustomValidators.pattern(/^(?=.*[0-9])(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])(.{8,})$/i, 'weakPassword'),
]) ]
const formObj = this.createMode ? registerForm : loginForm;
this.userForm = this.formBuilder.group(formObj);
}
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/forms/form-error-messages.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { AbstractControl, AbstractControlDirective } from '@angular/forms';
invalidEndTime {End time cannot be before start time}
dateInPast {Cannot be before current date}
invalidPassword {Password is not valid}
weakPassword {Password is too weak}
pattern {Invalid input. Hover for more info}
invalidFirstCharacter {Must start with letter or number}
invalidFutureDate {Cannot be after current date}
Expand Down
Loading