I'm having problems using Flask-JWT in my application, I am using the authenticate and identity like this:
def authenticate(username, password):
session = db.Session()
user = session.query(db.Operators).filter_by(username= username).first()
if user and bcrypt.check_password_hash(user.password, password):
return user
def identity(payload):
user_id = payload['identity']
session = db.Session()
return session.query(db.Operators).filter_by(idOperator= user_id)
But I get an error because I do not have an id field in my db table because I have an idOperator
How can I solve this problem? The _default_jwt_payload_handler(identity) function goes to seek for an Id field, how can I change this automatic id field to an IdOperator without changing the init.py of flask-jwt?
Thanks