1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Implemented configurable minimum signup age

Implements https://github.com/Chocobozzz/PeerTube/issues/3612

Fixed lint and removed debug

Fixed another lint error

Apply suggestions from code review

Co-authored-by: Chocobozzz <chocobozzz@cpy.re>

Add tests for min signup age config
This commit is contained in:
Poslovitch 2021-04-24 09:57:01 +00:00 committed by Chocobozzz
parent f22e0e2c19
commit 1f256e7d3c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
21 changed files with 55 additions and 11 deletions

View file

@ -49,6 +49,15 @@ export const SIGNUP_LIMIT_VALIDATOR: BuildFormValidator = {
}
}
export const SIGNUP_MINIMUM_AGE_VALIDATOR: BuildFormValidator = {
VALIDATORS: [Validators.required, Validators.min(1), Validators.pattern('[0-9]+')],
MESSAGES: {
'required': $localize`Signup minimum age is required.`,
'min': $localize`Signup minimum age must be greater than 1.`,
'pattern': $localize`Signup minimum age must be a number.`
}
}
export const ADMIN_EMAIL_VALIDATOR: BuildFormValidator = {
VALIDATORS: [Validators.required, Validators.email],
MESSAGES: {