File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 2424jwt = JWTManager (app )
2525
2626"""
27- `claims` are data we choose to attached to each jwt payload
27+ `claims` are data we choose to attach to each jwt payload
2828and for each jwt protected endpoint, we can retrieve these claims via `get_jwt_claims()`
2929one possible use case for claims are access level control, which is shown below
3030"""
3131@jwt .user_claims_loader
3232def add_claims_to_jwt (identity ):
33- if identity == 1 : # instead of hard-coding, we can read from a config file to get a list of admins instead
33+ if identity == 1 : # instead of hard-coding, we should read from a config file to get a list of admins instead
3434 return {'is_admin' : True }
3535 return {'is_admin' : False }
3636
Original file line number Diff line number Diff line change @@ -80,4 +80,4 @@ def get(self):
8080 items = [item .json () for item in ItemModel .find_all ()]
8181 if user_id :
8282 return {'items' : items }, 200
83- return {'items' : [item ['name' ] for item in items ]}, 401
83+ return {'items' : [item ['name' ] for item in items ]}, 200
You can’t perform that action at this time.
0 commit comments