Skip to content

Commit 91af634

Browse files
authored
chore(console, api): soft and hard regexes for usernames (#525)
Regular users can no longer use "apify" in their usernames. Admins still can.
1 parent bde84f7 commit 91af634

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/consts/src/consts.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ export const USERNAME = {
115115
MIN_LENGTH: 3,
116116
MAX_LENGTH: 30,
117117

118-
// Regex matching a potentially allowed username. The numbers must match MIN and MAX!
118+
// Regexes matching a potentially allowed username. The numbers must match MIN and MAX!
119119
// Note that username must also pass isForbiddenUser() test to be allowed!
120-
REGEX: /^[a-zA-Z0-9_.-]{3,30}$/,
120+
REGEX: /^[a-z0-9_.-]{3,30}$/i,
121+
RESTRICTED_REGEX: /^(?!.*apify)[a-z0-9_.-]{3,30}$/i,
121122
};
122123

123124
export const EMAIL = {

0 commit comments

Comments
 (0)