From 09c2bedde69fd5533228e93362230f0169cb914f Mon Sep 17 00:00:00 2001 From: Renard Date: Sun, 26 Jul 2020 22:42:46 -0400 Subject: Login fix --- cgi/modapi.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cgi') diff --git a/cgi/modapi.py b/cgi/modapi.py index 9b94c0f..b05410d 100644 --- a/cgi/modapi.py +++ b/cgi/modapi.py @@ -66,6 +66,8 @@ def api_process(self, path_split): logAction('', 'Failed log-in. Username:'+_mysql.escape_string( self.formdata['username'])+' IP:'+self.environ["REMOTE_ADDR"]) raise APIError, "Incorrect username/password." + else: + raise APIError, "Bad request" else: raise APIError, "Not authenticated" else: @@ -85,11 +87,7 @@ def api_process(self, path_split): "SELECT * FROM `news` WHERE type = '0' ORDER BY `timestamp` DESC") values['posts'] = posts elif method == 'login': - # testing - username = formdata.get('username') - password = formdata.get('password') - values['username'] = username - values['password'] = password + values['token'] = token else: raise APIError, "Invalid method" -- cgit v1.2.1-18-gbd029