Skip to content

Commit

Permalink
oauth: handle a string expires_in value gracefully
Browse files Browse the repository at this point in the history
If an OAuth token's expires_in field is a string instead of an int,
simply try to convert it to an int first.

Fixes #179
  • Loading branch information
mikix committed Sep 10, 2024
1 parent 19f964c commit 4317562
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fhirclient/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def _request_access_token(self, server, params):
del ret_params['access_token']

if 'expires_in' in ret_params:
expires_in = ret_params.get('expires_in')
expires_in = int(ret_params['expires_in'])
self.expires_at = datetime.now() + timedelta(seconds=expires_in)
del ret_params['expires_in']

Expand Down

0 comments on commit 4317562

Please sign in to comment.