add error checking for non-existent users trying to log in

This commit is contained in:
2025-07-03 09:22:43 +02:00
parent 6d8051e4e6
commit 290395d38d

View File

@@ -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