From 0f2302a4a526b991a46bf4aabc93c43cede58535 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 3 Apr 2022 15:44:44 -0400 Subject: [PATCH] fix login with older mastodon servers --- mastodon/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/api.py b/mastodon/api.py index 976293a1..c2152b80 100644 --- a/mastodon/api.py +++ b/mastodon/api.py @@ -304,8 +304,7 @@ def obtain_token(site, request, code): 'client_secret': mast_app.client_secret, 'redirect_uri': redirect_uri, 'grant_type': 'authorization_code', - 'code': code, - 'code_verifier': 'challenge' + 'code': code } headers = {'User-Agent': 'NeoDB/1.0'} auth = None @@ -315,6 +314,7 @@ def obtain_token(site, request, code): url = TWITTER_API_TOKEN auth = (mast_app.client_id, mast_app.client_secret) del payload['client_secret'] + payload['code_verifier'] = 'challenge' else: url = 'https://' + mast_app.domain_name + API_OBTAIN_TOKEN response = post(url, data=payload, headers=headers, auth=auth)