Browse Source

Add code to oauth2 token get

pull/161/head
Luke 6 years ago
parent
commit
7147ddfda7
  1. 3
      disco/api/client.py

3
disco/api/client.py

@ -106,7 +106,7 @@ class APIClient(LoggingClass):
data = self.http(Routes.GATEWAY_BOT_GET).json() data = self.http(Routes.GATEWAY_BOT_GET).json()
return data return data
def oauth2_token_get(self, grant_type, scope, refresh_token=None, redirect_url=None): def oauth2_token_get(self, grant_type, scope, code=None, refresh_token=None, redirect_url=None):
payload = { payload = {
'client_id': self.client.state.me.id, 'client_id': self.client.state.me.id,
'client_secret': self.client.config.secret, 'client_secret': self.client.config.secret,
@ -114,6 +114,7 @@ class APIClient(LoggingClass):
'scope': scope, 'scope': scope,
} }
payload.update(optional( payload.update(optional(
code=code,
refresh_token=refresh_token, refresh_token=refresh_token,
redirect_url=redirect_url, redirect_url=redirect_url,
)) ))

Loading…
Cancel
Save