From 32b21898fb2b53b1a2e36270de6854ad70e9e9bf Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 2 Sep 2021 20:23:22 +0000 Subject: [PATCH 1/2] lowercase username to lock password --- firstuseauthenticator/firstuseauthenticator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firstuseauthenticator/firstuseauthenticator.py b/firstuseauthenticator/firstuseauthenticator.py index fa4f161..1b45aa5 100644 --- a/firstuseauthenticator/firstuseauthenticator.py +++ b/firstuseauthenticator/firstuseauthenticator.py @@ -138,7 +138,7 @@ def validate_username(self, name): @gen.coroutine def authenticate(self, handler, data): - username = data['username'] + username = data['username'].lower() if not self.create_users: if not self._user_exists(username): From 9e200d974e0cb85d828a6afedb8ab90a37878f28 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 26 Oct 2021 09:00:03 +0200 Subject: [PATCH 2/2] Use normalize_username instead of .lower allows for following normalization changes --- firstuseauthenticator/firstuseauthenticator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firstuseauthenticator/firstuseauthenticator.py b/firstuseauthenticator/firstuseauthenticator.py index 1b45aa5..7062b19 100644 --- a/firstuseauthenticator/firstuseauthenticator.py +++ b/firstuseauthenticator/firstuseauthenticator.py @@ -138,7 +138,7 @@ def validate_username(self, name): @gen.coroutine def authenticate(self, handler, data): - username = data['username'].lower() + username = self.normalize_username(data['username']) if not self.create_users: if not self._user_exists(username):