diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-28 10:21:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-28 10:22:50 +0200 |
commit | 012580d98f489e599d44a9a2a0bdc892b9455a90 (patch) | |
tree | cd6d4abdbf43f4cd1c051ac49682b97c7b6dca92 /client/src/app/shared/form-validators | |
parent | d6d96bed80700830063c6055969d2d2ff46c63c6 (diff) | |
download | PeerTube-012580d98f489e599d44a9a2a0bdc892b9455a90.tar.gz PeerTube-012580d98f489e599d44a9a2a0bdc892b9455a90.tar.zst PeerTube-012580d98f489e599d44a9a2a0bdc892b9455a90.zip |
Cleanup
We must not expose private actor objects to clients
Just make 2 GET requests on channel/accounts instead
Diffstat (limited to 'client/src/app/shared/form-validators')
-rw-r--r-- | client/src/app/shared/form-validators/user-validators.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/shared/form-validators/user-validators.ts b/client/src/app/shared/form-validators/user-validators.ts index fee37e95f..976c97b87 100644 --- a/client/src/app/shared/form-validators/user-validators.ts +++ b/client/src/app/shared/form-validators/user-validators.ts | |||
@@ -1,12 +1,14 @@ | |||
1 | import { Validators } from '@angular/forms' | 1 | import { Validators } from '@angular/forms' |
2 | import { BuildFormValidator } from './form-validator.model' | 2 | import { BuildFormValidator } from './form-validator.model' |
3 | 3 | ||
4 | export const USER_USERNAME_REGEX_CHARACTERS = '[a-z0-9][a-z0-9._]' | ||
5 | |||
4 | export const USER_USERNAME_VALIDATOR: BuildFormValidator = { | 6 | export const USER_USERNAME_VALIDATOR: BuildFormValidator = { |
5 | VALIDATORS: [ | 7 | VALIDATORS: [ |
6 | Validators.required, | 8 | Validators.required, |
7 | Validators.minLength(1), | 9 | Validators.minLength(1), |
8 | Validators.maxLength(50), | 10 | Validators.maxLength(50), |
9 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | 11 | Validators.pattern(new RegExp(`^${USER_USERNAME_REGEX_CHARACTERS}*$`)) |
10 | ], | 12 | ], |
11 | MESSAGES: { | 13 | MESSAGES: { |
12 | 'required': $localize`Username is required.`, | 14 | 'required': $localize`Username is required.`, |