Closed
Description
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": "le_baguette_au_fromage@france.fr"})
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 asidentity
. - Make
create_access_token
raise an error when a dictionary is passed asidentity
.
Thanks for your time and for considering this!
Metadata
Metadata
Assignees
Labels
No labels