aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Renard 2020-07-26 22:42:46 -0400
committerLibravatar Renard 2020-07-26 22:42:46 -0400
commit09c2bedde69fd5533228e93362230f0169cb914f (patch)
tree5b6fbbc4fd9b6d8c86605acde9239257a12d5389
parent20904a13060604c2fb658a416fabd8958469a506 (diff)
downloadweabot-09c2bedde69fd5533228e93362230f0169cb914f.tar.gz
weabot-09c2bedde69fd5533228e93362230f0169cb914f.tar.xz
weabot-09c2bedde69fd5533228e93362230f0169cb914f.zip
Login fix
-rw-r--r--cgi/modapi.py8
1 files changed, 3 insertions, 5 deletions
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"