Skip to content

Commit 33cfc80

Browse files
committed
💡 (Flask-JWT-Extended) Remove unnecessary comments and imports
1 parent 4fb2eb9 commit 33cfc80

File tree

16 files changed

+3
-129
lines changed

16 files changed

+3
-129
lines changed

docs/docs/08_flask_jwt_extended/03_flask_jwt_extended_setup/end/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ def create_app(db_url=None):
2525
db.init_app(app)
2626
api = Api(app)
2727

28-
"""
29-
JWT related configuration. The following functions includes:
30-
1) add claims to each jwt
31-
2) customize the token expired error message
32-
"""
3328
app.config["JWT_SECRET_KEY"] = "jose"
3429
jwt = JWTManager(app)
3530

docs/docs/08_flask_jwt_extended/04_user_model_and_schema/end/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ def create_app(db_url=None):
2525
db.init_app(app)
2626
api = Api(app)
2727

28-
"""
29-
JWT related configuration. The following functions includes:
30-
1) add claims to each jwt
31-
2) customize the token expired error message
32-
"""
3328
app.config["JWT_SECRET_KEY"] = "jose"
3429
jwt = JWTManager(app)
3530

docs/docs/08_flask_jwt_extended/04_user_model_and_schema/start/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ def create_app(db_url=None):
2525
db.init_app(app)
2626
api = Api(app)
2727

28-
"""
29-
JWT related configuration. The following functions includes:
30-
1) add claims to each jwt
31-
2) customize the token expired error message
32-
"""
3328
app.config["JWT_SECRET_KEY"] = "jose"
3429
jwt = JWTManager(app)
3530

docs/docs/08_flask_jwt_extended/05_registering_users_rest_api/end/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

docs/docs/08_flask_jwt_extended/05_registering_users_rest_api/start/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ def create_app(db_url=None):
2525
db.init_app(app)
2626
api = Api(app)
2727

28-
"""
29-
JWT related configuration. The following functions includes:
30-
1) add claims to each jwt
31-
2) customize the token expired error message
32-
"""
3328
app.config["JWT_SECRET_KEY"] = "jose"
3429
jwt = JWTManager(app)
3530

docs/docs/08_flask_jwt_extended/06_login_users_rest_api/end/app.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, jsonify
1+
from flask import Flask
22
from flask_smorest import Api
33
from flask_jwt_extended import JWTManager
44

@@ -26,11 +26,6 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

docs/docs/08_flask_jwt_extended/06_login_users_rest_api/start/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

docs/docs/08_flask_jwt_extended/07_protect_resources_with_jwt_required/end/app.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,9 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

37-
"""
38-
`claims` are data we choose to attach to each jwt payload
39-
and for each jwt protected endpoint, we can retrieve these claims via `get_jwt_claims()`
40-
one possible use case for claims are access level control, which is shown below
41-
"""
42-
4332
@jwt.expired_token_loader
4433
def expired_token_callback(jwt_header, jwt_payload):
4534
return (

docs/docs/08_flask_jwt_extended/07_protect_resources_with_jwt_required/start/app.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, jsonify
1+
from flask import Flask
22
from flask_smorest import Api
33
from flask_jwt_extended import JWTManager
44

@@ -26,11 +26,6 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

docs/docs/08_flask_jwt_extended/08_jwt_claims_and_authorization/end/app.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,9 @@ def create_app(db_url=None):
2626
db.init_app(app)
2727
api = Api(app)
2828

29-
"""
30-
JWT related configuration. The following functions includes:
31-
1) add claims to each jwt
32-
2) customize the token expired error message
33-
"""
3429
app.config["JWT_SECRET_KEY"] = "jose"
3530
jwt = JWTManager(app)
3631

37-
"""
38-
`claims` are data we choose to attach to each jwt payload
39-
and for each jwt protected endpoint, we can retrieve these claims via `get_jwt_claims()`
40-
one possible use case for claims are access level control, which is shown below
41-
"""
42-
4332
# @jwt.additional_claims_loader
4433
# def add_claims_to_jwt(identity):
4534
# # TODO: Read from a config file instead of hard-coding

0 commit comments

Comments
 (0)