Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev #3621

Merged
merged 14 commits into from
Jul 4, 2024
Prev Previous commit
Next Next commit
Merge branch 'refs/heads/main' into custom-openid-claims
# Conflicts:
#	backend/main.py
  • Loading branch information
Sergey Mihaylin committed Jul 1, 2024
commit 6e934c2d17e5d1c9367e287b10cbcc21625c3d6e
8 changes: 6 additions & 2 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,8 1920,7 @@ async def oauth_callback(provider: str, request: Request, response: Response):
if existing_user:
raise HTTPException(400, detail=ERROR_MESSAGES.EMAIL_TAKEN)

picture_claim = webui_app.state.config.OAUTH_PICTURE_CLAIM
picture_url = user_data.get(picture_claim, "")
picture_url = user_data.get("picture", "")
if picture_url:
# Download the profile image into a base64 string
try:
Expand All @@ -1942,6 1941,11 @@ async def oauth_callback(provider: str, request: Request, response: Response):
if not picture_url:
picture_url = "/user.png"
username_claim = webui_app.state.config.OAUTH_USERNAME_CLAIM
role = (
"admin"
if Users.get_num_users() == 0
else webui_app.state.config.DEFAULT_USER_ROLE
)
user = Auths.insert_new_auth(
email=email,
password=get_password_hash(
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.