浏览代码

fix: handle broader request exceptions in OAuth process (#11997)

Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/0.14.2
-LAN- 10 个月前
父节点
当前提交
03548cdfbc
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      api/controllers/console/auth/oauth.py

+ 1
- 1
api/controllers/console/auth/oauth.py 查看文件

try: try:
token = oauth_provider.get_access_token(code) token = oauth_provider.get_access_token(code)
user_info = oauth_provider.get_user_info(token) user_info = oauth_provider.get_user_info(token)
except requests.exceptions.HTTPError as e:
except requests.exceptions.RequestException as e:
logging.exception(f"An error occurred during the OAuth process with {provider}: {e.response.text}") logging.exception(f"An error occurred during the OAuth process with {provider}: {e.response.text}")
return {"error": "OAuth process failed"}, 400 return {"error": "OAuth process failed"}, 400



正在加载...
取消
保存