diff options
author | Josh Holmer <jholmer@activecampaign.com> | 2019-04-30 12:50:43 -0400 |
---|---|---|
committer | Josh Holmer <jholmer@activecampaign.com> | 2019-04-30 12:50:43 -0400 |
commit | 73092d039fa67a88d0989e7bf0ae7d0044a0bdc6 (patch) | |
tree | 47ca440d40171ac9698f418629732b8ba811b5e9 /oauthlib/oauth2/rfc6749 | |
parent | 30321dd3c0ca784d3508a1970cf90d9f76835c79 (diff) | |
download | oauthlib-73092d039fa67a88d0989e7bf0ae7d0044a0bdc6.tar.gz |
Handle null value in expires_in field in JSON handler
Closes #672
Diffstat (limited to 'oauthlib/oauth2/rfc6749')
-rw-r--r-- | oauthlib/oauth2/rfc6749/parameters.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/oauthlib/oauth2/rfc6749/parameters.py b/oauthlib/oauth2/rfc6749/parameters.py index 6b9d630..f8d42db 100644 --- a/oauthlib/oauth2/rfc6749/parameters.py +++ b/oauthlib/oauth2/rfc6749/parameters.py @@ -419,7 +419,10 @@ def parse_token_response(body, scope=None): params['scope'] = scope_to_list(params['scope']) if 'expires_in' in params: - params['expires_at'] = time.time() + int(params['expires_in']) + if params['expires_in'] is None: + params.pop('expires_in') + else: + params['expires_at'] = time.time() + int(params['expires_in']) params = OAuth2Token(params, old_scope=scope) validate_token_parameters(params) |