mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-27 03:37:07 +00:00
Enforce password complexity. Ref https://github.com/GNS3/gns3-gui/issues/3698
This commit is contained in:
parent
050d4158ed
commit
445ce5a864
@ -4,7 +4,7 @@
|
|||||||
<mat-form-field class="input-field">
|
<mat-form-field class="input-field">
|
||||||
<input matInput type="password" formControlName="password" placeholder="Password"/>
|
<input matInput type="password" formControlName="password" placeholder="Password"/>
|
||||||
<mat-error *ngIf="passwordForm.password?.touched && passwordForm.password?.errors"
|
<mat-error *ngIf="passwordForm.password?.touched && passwordForm.password?.errors"
|
||||||
>Password must be between 6 and 100 characters.
|
>Password must be at least 8 characters long and contain at least one digit, one lowercase letter and one uppercase letter.
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="input-field">
|
<mat-form-field class="input-field">
|
||||||
|
@ -23,12 +23,13 @@ export class ChangeUserPasswordComponent implements OnInit {
|
|||||||
private toasterService: ToasterService) { }
|
private toasterService: ToasterService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
const password_regex = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8}$/;
|
||||||
this.user = this.data.user;
|
this.user = this.data.user;
|
||||||
this.editPasswordForm = new UntypedFormGroup({
|
this.editPasswordForm = new UntypedFormGroup({
|
||||||
password: new UntypedFormControl(null,
|
password: new UntypedFormControl(null,
|
||||||
[Validators.minLength(6), Validators.maxLength(100), Validators.required] ),
|
[Validators.minLength(6), Validators.maxLength(100), Validators.pattern(password_regex), Validators.required] ),
|
||||||
confirmPassword: new UntypedFormControl(null,
|
confirmPassword: new UntypedFormControl(null,
|
||||||
[Validators.minLength(6), Validators.maxLength(100), Validators.required] ),
|
[Validators.minLength(6), Validators.maxLength(100), Validators.pattern(password_regex), Validators.required] ),
|
||||||
},{
|
},{
|
||||||
validators: [matchingPassword]
|
validators: [matchingPassword]
|
||||||
})
|
})
|
||||||
|
@ -37,7 +37,7 @@ export class LoggedUserComponent implements OnInit {
|
|||||||
|
|
||||||
changePassword() {
|
changePassword() {
|
||||||
this.dialog.open<ChangeUserPasswordComponent>(ChangeUserPasswordComponent,
|
this.dialog.open<ChangeUserPasswordComponent>(ChangeUserPasswordComponent,
|
||||||
{width: '400px', height: '300px', data: {user: this.user, controller: this.controller, self_update: true}});
|
{width: '500px', height: '300px', data: {user: this.user, controller: this.controller, self_update: true}});
|
||||||
}
|
}
|
||||||
|
|
||||||
copyToken() {
|
copyToken() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user