So I have a JWT token being generated and after 10 minutes it expires. Once it expires, I want to be able to catch this 401 error code. I am using flask_jwt_extended library. This is my code:
@dossier_blueprint.route("/week", methods=["GET"])
@jwt_required
# @app.cache.cached(timeout=800)
def get_dossier_created_this_week():
return dossier_service.query_aantal_dossiers_deze_week_bvcm_c2c()