diff --git a/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.html b/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.html index 9e4b8c1..7ca52ec 100644 --- a/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.html +++ b/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.html @@ -14,6 +14,9 @@
This field is required.
+
+ Username must contain only lower case letters and numbers. +
Username must be between 3 and 50 letters.
diff --git a/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.ts b/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.ts index ed84eff..4dda8e5 100644 --- a/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.ts +++ b/client/app/experiment-participants/create-user-account-dialog/create-user-account-dialog.component.ts @@ -54,7 +54,7 @@ export class CreateUserAccountDialogComponent implements OnInit, OnDestroy { password = new FormControl("", [Validators.required, Validators.minLength(4)]) - username = new FormControl("", [Validators.required, Validators.minLength(3), Validators.maxLength(50), noDuplicateValidator(this.data.participants.map(p => p.username))]) + username = new FormControl("", [Validators.required, Validators.minLength(3), Validators.pattern('^[a-z0-9]+$'), Validators.maxLength(50), noDuplicateValidator(this.data.participants.map(p => p.username))]) email = new FormControl("changeme@email.com", [Validators.required, Validators.email])