fix: when request access_token is post method, http body has no json data

pull/10501/head
景朝阳 2023-05-18 20:40:41 +08:00 committed by GitHub
parent 48fca8f0f3
commit efb31d6f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -104,7 +104,10 @@ class OAuth2Backend(JMSModelBackend):
headers = {
'Accept': 'application/json'
}
access_token_response = requests_func(access_token_url, headers=headers)
if token_method == 'post':
access_token_response = requests_func(access_token_url, headers=headers, json=query_dict)
else:
access_token_response = requests_func(access_token_url, headers=headers)
try:
access_token_response.raise_for_status()
access_token_response_data = access_token_response.json()