From 7e7ab7a15d20e72b230d646cbd786bab014bde9d Mon Sep 17 00:00:00 2001 From: lsde Date: Fri, 21 Sep 2018 16:08:55 +0200 Subject: [PATCH] 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". --- server/helpers/custom-validators/activitypub/actor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index 6958b2b00..77c003cdf 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts @@ -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) }