Hello,
First of all, thank you for your package—it has been incredibly useful to me!
I encountered an issue in the latest version due to a breaking change in the identity parameter for create_access_token. Specifically, the following code:
@auth_bp.route("/something", methods=["POST"])
def something() -> Tuple[Response, int]:
from flask_jwt_extended import create_access_token, decode_token
test = create_access_token(identity={"email": "[email protected]"})
try:
decode_token(test)
print("success")
except:
print("fail")
return jsonify({"error": "Decode failed"}), 401
Now results in the last line (jsonify({"error": "Decode failed"}), 401) being executed.
I believe one of the following changes could address the issue:
- Add support in
decode_token for dictionaries as identity.
- Make
create_access_token raise an error when a dictionary is passed as identity.
Thanks for your time and for considering this!