fix(typing): validate OAuth code before processing access token (#18288)

pull/18320/head
Yeuoly 12 months ago committed by GitHub
parent defd5520ea
commit 8f547e6340
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -74,7 +74,9 @@ class OAuthDataSourceBinding(Resource):
if not oauth_provider:
return {"error": "Invalid provider"}, 400
if "code" in request.args:
code = request.args.get("code")
code = request.args.get("code", "")
if not code:
return {"error": "Invalid code"}, 400
try:
oauth_provider.get_access_token(code)
except requests.exceptions.HTTPError as e:

Loading…
Cancel
Save