restore trimming of username input

continue to not trim password or custom fields

trailing/leading space is explicitly forbidden in validate_username
This commit is contained in:
Min RK
2022-08-10 08:36:23 +02:00
parent 2f1d340c42
commit c9e6d6afa3
3 changed files with 18 additions and 5 deletions

View File

@@ -256,6 +256,9 @@ class Authenticator(LoggingConfigurable):
if not username:
# empty usernames are not allowed
return False
if username != username.strip():
# starting/ending with space is not allowed
return False
if not self.username_regex:
return True
return bool(self.username_regex.match(username))