Skip to content

Commit cea3c4b

Browse files
committed
get_raw_jwt now returns an empty dict if it isn't present
Prevents attribute errors on get_jwt_claims and get_jwt_identity if the raw jwt isn't on the stack
1 parent cd5783e commit cea3c4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_jwt_extended/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_jwt_identity():
3030
Returns the identity of the JWT in this context. If no JWT is present,
3131
None is returned.
3232
"""
33-
return get_raw_jwt().get('identity', None)
33+
return get_raw_jwt().get('identity', {})
3434

3535

3636
def get_jwt_claims():

0 commit comments

Comments
 (0)