add error checking for non-existent users trying to log in
This commit is contained in:
@@ -1217,11 +1217,14 @@ class Database:
|
||||
Returns:
|
||||
bool: True if the login was successful, False if not
|
||||
"""
|
||||
try:
|
||||
salt = self.query_db(
|
||||
"SELECT salt FROM user WHERE username=?", (user,), one=True
|
||||
)[0]
|
||||
if salt is None:
|
||||
return False
|
||||
except TypeError:
|
||||
return False
|
||||
hashed_password = salt + hashed_password
|
||||
password = self.query_db(
|
||||
"SELECT password FROM user WHERE username=?", (user,), one=True
|
||||
|
||||
Reference in New Issue
Block a user