浏览代码

fix: check for email claim before skipping userinfo endpoint

D. MacAlpine 2 月之前
父节点
当前提交
34b62e71cc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      backend/open_webui/utils/oauth.py

+ 1 - 1
backend/open_webui/utils/oauth.py

@@ -193,7 +193,7 @@ class OAuthManager:
             log.warning(f"OAuth callback error: {e}")
             raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
         user_data: UserInfo = token.get("userinfo")
-        if not user_data:
+        if not user_data or "email" not in user_data:
             user_data: UserInfo = await client.userinfo(token=token)
         if not user_data:
             log.warning(f"OAuth callback failed, user data is missing: {token}")