From 34b62e71cc1b0c3d98e7bc2b9d1091e2fbf1f0d2 Mon Sep 17 00:00:00 2001 From: "D. MacAlpine" Date: Wed, 5 Feb 2025 21:31:55 -0500 Subject: [PATCH] fix: check for email claim before skipping userinfo endpoint --- backend/open_webui/utils/oauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index 7c0c53c2d..83e0ca1d6 100644 --- a/backend/open_webui/utils/oauth.py +++ b/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}")