mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #10410] [MERGED] fix: GitHub OAuth email retrieval when public email is not set #45571
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/10410
Author: @xinhai-ai
Created: 2/20/2025
Status: ✅ Merged
Merged: 2/20/2025
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (1)
de8492dfix: GitHub OAuth email retrieval when public email is not set📊 Changes
1 file changed (+29 additions, -3 deletions)
View changed files
📝
backend/open_webui/utils/oauth.py(+29 -3)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
When someone's github public email is not set,
user_data.get(email_claim, "")will get a "None" ,which will lead toAttributeError: 'NoneType' object has no attribute 'lower',and return Internal Server Error.This commit use github List email addresses for the authenticated user to get user's emails and select the primary email as email,to avoid the error
Changed
When email is
Noneand provide isgithub,use the api to get the emails and select the primary email as the user's emailFixed
When github pubic email is not set ,oauth failed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.