Skip to content

Commit

Permalink
Merge pull request #197 from marc-marcos/main
Browse files Browse the repository at this point in the history
Add slash restriction to username validation
  • Loading branch information
lambdaTotoro authored Nov 13, 2021
2 parents d0165c8 + 831b984 commit 11e19fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nativeauthenticator/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def get_result_message(
if minimum_password_length > 0:
message = (
"Something went wrong!\nBe sure your username "
"does not contain spaces or commas, your "
"does not contain spaces, commas or slashes, your "
f"password has at least {minimum_password_length} "
"characters and is not too common."
)
# Error if minimum password length is 0.
else:
message = (
"Something went wrong!\nBe sure your username "
"does not contain spaces or commas and your "
"does not contain spaces, commas or slashes and your "
"password is not too common."
)
# If user creation went through & open-signup is enabled, success.
Expand Down
2 changes: 1 addition & 1 deletion nativeauthenticator/nativeauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def change_password(self, username, new_password):
return True

def validate_username(self, username):
invalid_chars = [",", " "]
invalid_chars = [",", " ", "/"]
if any((char in username) for char in invalid_chars):
return False
return super().validate_username(username)
Expand Down

0 comments on commit 11e19fb

Please sign in to comment.