Merge pull request #10501 from jingzhaoyang/dev

fix: when request access_token is post method, http body has no json …
pull/10511/head
老广 2023-05-19 10:43:32 +08:00 committed by GitHub
commit e40d65871b
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,6 +104,9 @@ class OAuth2Backend(JMSModelBackend):
headers = { headers = {
'Accept': 'application/json' 'Accept': 'application/json'
} }
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) access_token_response = requests_func(access_token_url, headers=headers)
try: try:
access_token_response.raise_for_status() access_token_response.raise_for_status()