Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reauthorization to work beyond the first time called #128

Merged
merged 3 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The following wonderful people contributed directly or indirectly to this projec
- Josh Mandel <https://github.com/jmandel>
- Nikolai Schwertner <https://github.com/nschwertner>
- Pascal Pfiffner <https://github.com/p2>
- Raheel Sayeed <https://github.com/raheelsayeed>
- Raheel Sayeed <https://github.com/raheelsayeed>
- Tim Harsch <https://github.com/timharsch>
- Trinadh Baranika <https://github.com/bktrinadh>

Please add yourself here alphabetically when you submit your first pull request.
6 changes: 3 additions & 3 deletions fhirclient/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ def _request_access_token(self, server, params):
# The refresh token issued by the authorization server. If present, the
# app should discard any previous refresh_token associated with this
# launch, replacing it with this new value.
refresh_token = ret_params.get('refresh_token')
refresh_token = ret_params.get('refresh_token') or params.get('refresh_token')
if refresh_token is not None:
self.refresh_token = refresh_token
del ret_params['refresh_token']

if 'refresh_token' in ret_params:
del ret_params['refresh_token']
logger.debug("SMART AUTH: Received access token: {0}, refresh token: {1}"
.format(self.access_token is not None, self.refresh_token is not None))
return ret_params
Expand Down