Skip to content

Commit 6b68e71

Browse files
authored
Merge pull request #761 from AnswerDotAI/erikgaas/oauth_data
Use data instead of json for oauth
2 parents 92f5652 + 083adf8 commit 6b68e71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fasthtml/oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def parse_response(self:_AppClient, code, redirect_uri):
139139
"Get the token from the oauth2 server response"
140140
payload = dict(code=code, redirect_uri=redirect_uri, client_id=self.client_id,
141141
client_secret=self.client_secret, grant_type='authorization_code')
142-
r = httpx.post(self.token_url, json=payload)
142+
r = httpx.post(self.token_url, data=payload)
143143
r.raise_for_status()
144144
self.parse_request_body_response(r.text)
145145

nbs/api/08_oauth.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
" \"Get the token from the oauth2 server response\"\n",
386386
" payload = dict(code=code, redirect_uri=redirect_uri, client_id=self.client_id,\n",
387387
" client_secret=self.client_secret, grant_type='authorization_code')\n",
388-
" r = httpx.post(self.token_url, json=payload)\n",
388+
" r = httpx.post(self.token_url, data=payload)\n",
389389
" r.raise_for_status()\n",
390390
" self.parse_request_body_response(r.text)"
391391
]

0 commit comments

Comments
 (0)