raise username length cap
This commit is contained in:
@@ -46,10 +46,12 @@ def create_session(user_id, temporary=False):
|
||||
})
|
||||
|
||||
def parse_username(username: str) -> Tuple[str, str]:
|
||||
"""first is the unmodified name/display name, second is username"""
|
||||
if len(username) < 3:
|
||||
raise ValueError
|
||||
|
||||
invalid_regex = r'[^a-zA-Z0-9_-]'
|
||||
return username, re.sub(invalid_regex, '_', username.lower())[:20]
|
||||
return username, re.sub(invalid_regex, '_', username.lower())[:24]
|
||||
|
||||
def is_password_valid(password: str) -> bool:
|
||||
return re.match(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}$', password) is not None
|
||||
|
||||
Reference in New Issue
Block a user