Skip to content

Commit

Permalink
fix Twitch account linking
Browse files Browse the repository at this point in the history
fixes LIBERAPAYCOM-1Y2
  • Loading branch information
Changaco committed Aug 3, 2024
1 parent 5d5234f commit 093dc82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions liberapay/elsewhere/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ class PlatformOAuth2(Platform):
oauth_default_scope = []
oauth_email_scope = None
oauth_follows_scope = ''
oauth_include_client_id = None

can_auth_with_client_credentials = None
use_basic_auth_for_app_session = False
Expand Down Expand Up @@ -561,9 +562,10 @@ def get_query_id(self, querystring):
def handle_auth_callback(self, domain, url, state, unused_arg):
sess = self.get_auth_session(domain, state=state)
client_secret = self.get_credentials(domain)[1]
sess.fetch_token(self.access_token_url.format(domain=domain),
client_secret=client_secret,
authorization_response=url)
sess.fetch_token(
self.access_token_url.format(domain=domain), client_secret=client_secret,
authorization_response=url, include_client_id=self.oauth_include_client_id,
)
return sess


Expand Down
1 change: 1 addition & 0 deletions liberapay/elsewhere/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Twitch(PlatformOAuth2):
# Auth attributes
# https://dev.twitch.tv/docs/authentication/
auth_url = 'https://id.twitch.tv/oauth2/authorize'
oauth_include_client_id = True
access_token_url = 'https://id.twitch.tv/oauth2/token'
can_auth_with_client_credentials = True

Expand Down

0 comments on commit 093dc82

Please sign in to comment.