From 7fd552152af74f0c16eee5e5a3ab31553dfa0733 Mon Sep 17 00:00:00 2001 From: marc-marcos <53276599+marc-marcos@users.noreply.github.com> Date: Sat, 13 Nov 2021 16:54:30 +0100 Subject: [PATCH 1/3] Add slash restriction to username validation Documentation said that spaces, commas and slasher weren't allowed but only the restriction of commas and spaces was enforced. --- nativeauthenticator/nativeauthenticator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativeauthenticator/nativeauthenticator.py b/nativeauthenticator/nativeauthenticator.py index 3957226..5af864a 100644 --- a/nativeauthenticator/nativeauthenticator.py +++ b/nativeauthenticator/nativeauthenticator.py @@ -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) From 2eb5e46b2b87e9c4decd852ebf9f361ac913d855 Mon Sep 17 00:00:00 2001 From: Marc Marcos Date: Sat, 13 Nov 2021 17:58:46 +0100 Subject: [PATCH 2/3] error message when using slashes --- nativeauthenticator/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativeauthenticator/handlers.py b/nativeauthenticator/handlers.py index 300c1c0..b88086d 100644 --- a/nativeauthenticator/handlers.py +++ b/nativeauthenticator/handlers.py @@ -100,7 +100,7 @@ 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." ) From 831b9841d179611d51705aa42053cd02e37032ef Mon Sep 17 00:00:00 2001 From: Marc Marcos Date: Sat, 13 Nov 2021 17:59:47 +0100 Subject: [PATCH 3/3] another message --- nativeauthenticator/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativeauthenticator/handlers.py b/nativeauthenticator/handlers.py index b88086d..757ccee 100644 --- a/nativeauthenticator/handlers.py +++ b/nativeauthenticator/handlers.py @@ -108,7 +108,7 @@ def get_result_message( 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.