+Fix On user in login not there it makes an error. +Added On user or pass incorect make indicator.

This commit is contained in:
Tim Berchtold 2025-07-21 15:28:57 +02:00
parent 321923b056
commit cffe60b109
4 changed files with 64 additions and 6 deletions

View file

@ -12,9 +12,13 @@ config.read('Options.ini')
class compare:
def is_user_pass_valid(username, password):
session_username = session.query(User).filter(User.username == username).one()
session.commit()
try: #check if username in db
session_username = session.query(User).filter(User.username == username).one()
session.commit()
except:
return False
print(session_username.hashed_password)
if bcrypt.hashpw(password.encode('utf-8'), session_username.salt) == session_username.hashed_password.encode('utf-8'):
return True