Skip to content

Commit

Permalink
Merge pull request #22 from jkakavas/fix_refresh_token_param
Browse files Browse the repository at this point in the history
Return refresh token only if we issue one
  • Loading branch information
johanlundberg authored Oct 16, 2017
2 parents cf57877 + f696187 commit bc89540
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pyop/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ def _do_code_exchange(self, request, # type: Dict[str, str]

access_token = self.authz_state.exchange_code_for_token(token_request['code'])
self._add_access_token_to_response(response, access_token)
response['refresh_token'] = self.authz_state.create_refresh_token(access_token.value)
refresh_token = self.authz_state.create_refresh_token(access_token.value)
if refresh_token is not None:
response['refresh_token'] = refresh_token

if extra_id_token_claims is None:
extra_id_token_claims = {}
Expand Down

0 comments on commit bc89540

Please sign in to comment.