Skip to content

Commit 4317562

Browse files
committed
oauth: handle a string expires_in value gracefully
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
1 parent 19f964c commit 4317562

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fhirclient/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _request_access_token(self, server, params):
283283
del ret_params['access_token']
284284

285285
if 'expires_in' in ret_params:
286-
expires_in = ret_params.get('expires_in')
286+
expires_in = int(ret_params['expires_in'])
287287
self.expires_at = datetime.now() + timedelta(seconds=expires_in)
288288
del ret_params['expires_in']
289289

0 commit comments

Comments
 (0)