Allow dots in usernames (e.g. user.test)
Added . to the username character whitelist regex. No security reason to exclude it — dots are standard in usernames. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e860723a2a
commit
0fc3f1a14b
@ -26,8 +26,8 @@ def _validate_username(v: str) -> str:
|
||||
v = v.strip().lower()
|
||||
if not 3 <= len(v) <= 50:
|
||||
raise ValueError("Username must be 3–50 characters")
|
||||
if not re.fullmatch(r"[a-z0-9_\-]+", v):
|
||||
raise ValueError("Username may only contain letters, numbers, _ and -")
|
||||
if not re.fullmatch(r"[a-z0-9_.\-]+", v):
|
||||
raise ValueError("Username may only contain letters, numbers, _ . and -")
|
||||
return v
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user