Skip to content

Commit

Permalink
Make get_unverified_claims() return a dict
Browse files Browse the repository at this point in the history
So far the above method returned the unprocessed string it received from
`_load()`.

This commit parses the payload before returning it in order to comply
with the documentation.
  • Loading branch information
0x64746b committed Apr 27, 2016
1 parent 252ecd5 commit be3d4fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jose/jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ def get_unverified_claims(token):
JWSError: If there is an exception decoding the token.
"""
header, claims, signing_input, signature = _load(token)
return claims

try:
return json.loads(claims.decode('utf-8'))
except ValueError as e:
raise JWSError('Invalid claims string: %s' % e)


def _encode_header(algorithm, additional_headers=None):
Expand Down

0 comments on commit be3d4fc

Please sign in to comment.