From 22af53f60ce97b628d65d2def7d4b3bff1313a4e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 10 Jul 2025 11:14:53 +0400 Subject: [PATCH] refac --- backend/open_webui/config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 26fbfa84c5..26623c95a4 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -13,6 +13,8 @@ from urllib.parse import urlparse import requests from pydantic import BaseModel from sqlalchemy import JSON, Column, DateTime, Integer, func +from authlib.integrations.starlette_client import OAuth + from open_webui.env import ( DATA_DIR, @@ -546,7 +548,7 @@ def load_oauth_providers(): OAUTH_PROVIDERS.clear() if GOOGLE_CLIENT_ID.value and GOOGLE_CLIENT_SECRET.value: - def google_oauth_register(client): + def google_oauth_register(client: OAuth): client.register( name="google", client_id=GOOGLE_CLIENT_ID.value, @@ -574,7 +576,7 @@ def load_oauth_providers(): and MICROSOFT_CLIENT_TENANT_ID.value ): - def microsoft_oauth_register(client): + def microsoft_oauth_register(client: OAuth): client.register( name="microsoft", client_id=MICROSOFT_CLIENT_ID.value, @@ -599,7 +601,7 @@ def load_oauth_providers(): if GITHUB_CLIENT_ID.value and GITHUB_CLIENT_SECRET.value: - def github_oauth_register(client): + def github_oauth_register(client: OAuth): client.register( name="github", client_id=GITHUB_CLIENT_ID.value, @@ -631,7 +633,7 @@ def load_oauth_providers(): and OPENID_PROVIDER_URL.value ): - def oidc_oauth_register(client): + def oidc_oauth_register(client: OAuth): client_kwargs = { "scope": OAUTH_SCOPES.value, **(