From b22d5430c416b0d2fd6b7026b806547cdf85f6c5 Mon Sep 17 00:00:00 2001 From: Leticia Portella Date: Sun, 13 Oct 2019 12:11:48 +0100 Subject: [PATCH] add normalization to username --- nativeauthenticator/nativeauthenticator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nativeauthenticator/nativeauthenticator.py b/nativeauthenticator/nativeauthenticator.py index 446be91..500ceed 100644 --- a/nativeauthenticator/nativeauthenticator.py +++ b/nativeauthenticator/nativeauthenticator.py @@ -125,7 +125,7 @@ def successful_login(self, username): @gen.coroutine def authenticate(self, handler, data): - username = data['username'] + username = self.normalize_username(data['username']) password = data['password'] user = UserInfo.find(self.db, username) @@ -168,6 +168,7 @@ def is_password_strong(self, password): return all(checks) def get_or_create_user(self, username, pw, **kwargs): + username = self.normalize_username(username) user = UserInfo.find(self.db, username) if user: return user