Fixed binary is not serializable error #2

This commit is contained in:
Administrator 2022-03-27 21:21:20 +02:00
parent 67e2a4c761
commit 5dd0cb0b51
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ def login(data):
if query_user is None: # email doesn't exist
abort(500, message="Unable to login")
if not check_password(query_user.password, password): # Password incorrect
if not check_password(query_user.password, password.encode("utf-8")): # Password incorrect
abort(500, message="Unable to login")
token = jwt.encode({'email': query_user.email, 'exp': datetime.datetime.utcnow() + datetime.timedelta(minutes=45)}, os.getenv('SECRET_KEY'), "HS256")

View File

@ -14,7 +14,7 @@ def hash_password(password):
def check_password(hashed_password, user_password):
return bcrypt.checkpw(hashed_password.encode("utf-8"), user_password)
return bcrypt.checkpw(user_password, hashed_password)
def get_token():