Fixed binary is not serializable error #2
This commit is contained in:
parent
67e2a4c761
commit
5dd0cb0b51
@ -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")
|
||||
|
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user