Skip to content

Commit

Permalink
Merge pull request #2418 from liberapay/various
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Aug 4, 2024
2 parents f32081d + 093dc82 commit 254afd9
Show file tree
Hide file tree
Showing 3 changed files with 7 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
1 change: 1 addition & 0 deletions templates/layouts/components/navbar-logged-in.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<li><a href="/{{ user.username }}/ledger/">{{ _("Ledger") }}</a></li>
<li><a href="/{{ user.username }}/identity">{{ _("Identity") }}</a></li>
<li><a href="/{{ user.username }}/settings/">{{ _("Account") }}</a></li>
<li class="level2"><a href="/{{ user.username }}/settings/close">{{ _("Close Account") }}</a></li>
<li><a href="/{{ user.username }}/emails/">{{ _("Emails") }}</a></li>
<li><a href="/{{ user.username }}/notifications">{{ _("Notifications") }}</a></li>
<li><a href="/{{ user.username }}/widgets/">{{ _("Widgets") }}</a></li>
Expand Down

0 comments on commit 254afd9

Please sign in to comment.