Browse Source

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

tags/1.3.0
Yeuoly 6 months ago
parent
commit
8f547e6340
No account linked to committer's email address
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      api/controllers/console/auth/data_source_oauth.py

+ 3
- 1
api/controllers/console/auth/data_source_oauth.py View File

@@ -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