1
0
Fork 0

Add dot into allowed actor username

One should have an oportunity to include a dot into the username.
Currently, it breaks the flow if one has an SSO in front of PeeTube which creates users with "name.surname".
This commit is contained in:
lsde 2018-09-21 16:08:55 +02:00 committed by Chocobozzz
parent 4ebf25fda0
commit 7e7ab7a15d
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ function isActorPublicKeyValid (publicKey: string) {
validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
}
const actorNameRegExp = new RegExp('^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_]+$')
const actorNameRegExp = new RegExp('^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_\.]+$')
function isActorPreferredUsernameValid (preferredUsername: string) {
return exists(preferredUsername) && validator.matches(preferredUsername, actorNameRegExp)
}