MCPcopy
hub / github.com/gitcoinco/web / get_github_user_token

Function get_github_user_token

app/git/utils.py:246–257  ·  view source on GitHub ↗

Get the Github authorization token.

(code, **kwargs)

Source from the content-addressed store, hash-verified

244
245
246def get_github_user_token(code, **kwargs):
247 """Get the Github authorization token."""
248 _params = {'code': code, 'client_id': settings.GITHUB_CLIENT_ID, 'client_secret': settings.GITHUB_CLIENT_SECRET}
249 # Add additional parameters to the request paramaters.
250 _params.update(kwargs)
251 response = requests.get(settings.GITHUB_TOKEN_URL, headers=JSON_HEADER, params=_params)
252 response = response.json()
253 scope = response.get('scope', None)
254 if scope:
255 access_token = response.get('access_token', None)
256 return access_token
257 return None
258
259
260def get_github_user_data(oauth_token):

Callers 1

Calls 1

updateMethod · 0.80

Tested by 1