From ead8f60e6582aa57051dcaa8f2f051deebc51157 Mon Sep 17 00:00:00 2001 From: Landon Gilbert-Bland Date: Fri, 19 Feb 2021 08:01:42 -0700 Subject: [PATCH] More documentation improvements --- docs/add_custom_data_claims.rst | 4 ++-- examples/additional_data_in_access_token.py | 2 +- examples/loaders.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/add_custom_data_claims.rst b/docs/add_custom_data_claims.rst index c8af5cb2..1265a26d 100644 --- a/docs/add_custom_data_claims.rst +++ b/docs/add_custom_data_claims.rst @@ -1,5 +1,5 @@ -Storing Data in Access Tokens -============================= +Storing Additional Data in JWTs +=============================== You may want to store additional information in the access token which you could later access in the protected views. This can be done using the ``additional_claims`` argument with the :func:`~flask_jwt_extended.create_access_token` or diff --git a/examples/additional_data_in_access_token.py b/examples/additional_data_in_access_token.py index 85d09a19..cf2ff7e2 100644 --- a/examples/additional_data_in_access_token.py +++ b/examples/additional_data_in_access_token.py @@ -30,7 +30,7 @@ def login(): # In a protected view, get the claims you added to the jwt with the # get_jwt() method @app.route("/protected", methods=["GET"]) -@jwt_required +@jwt_required() def protected(): claims = get_jwt() return jsonify(foo=claims["foo"]) diff --git a/examples/loaders.py b/examples/loaders.py index ff43764d..0dc5b537 100644 --- a/examples/loaders.py +++ b/examples/loaders.py @@ -28,7 +28,7 @@ def login(): @app.route("/protected", methods=["GET"]) -@jwt_required +@jwt_required() def protected(): return jsonify(hello="world")