diff --git a/nativeauthenticator/handlers.py b/nativeauthenticator/handlers.py index 3ed2461..b799ef5 100644 --- a/nativeauthenticator/handlers.py +++ b/nativeauthenticator/handlers.py @@ -136,7 +136,7 @@ async def post(self): if assume_human: user_info = { "username": self.get_body_argument("username", strip=False), - "signup_password": self.get_body_argument("pw", strip=False), + "password": self.get_body_argument("signup_password", strip=False), "email": self.get_body_argument("email", "", strip=False), "has_2fa": bool(self.get_body_argument("2fa", "", strip=False)), } diff --git a/nativeauthenticator/nativeauthenticator.py b/nativeauthenticator/nativeauthenticator.py index 5c30e01..93ad901 100644 --- a/nativeauthenticator/nativeauthenticator.py +++ b/nativeauthenticator/nativeauthenticator.py @@ -295,20 +295,20 @@ def get_authed_users(self): def user_exists(self, username): return self.get_user(username) is not None - def create_user(self, username, pw, **kwargs): + def create_user(self, username, password, **kwargs): username = self.normalize_username(username) if self.user_exists(username) or not self.validate_username(username): return - if not self.is_password_strong(pw): + if not self.is_password_strong(password): return if not self.enable_signup: return - encoded_pw = bcrypt.hashpw(pw.encode(), bcrypt.gensalt()) - infos = {"username": username, "password": encoded_pw} + encoded_password = bcrypt.hashpw(password.encode(), bcrypt.gensalt()) + infos = {"username": username, "password": encoded_password} infos.update(kwargs) if self.open_signup or username in self.get_authed_users():