mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac
This commit is contained in:
parent
7ad549b4fb
commit
0f8729dea2
2 changed files with 11 additions and 1 deletions
|
|
@ -620,6 +620,11 @@ OAUTH_UPDATE_PICTURE_ON_LOGIN = PersistentConfig(
|
|||
os.environ.get("OAUTH_UPDATE_PICTURE_ON_LOGIN", "False").lower() == "true",
|
||||
)
|
||||
|
||||
OAUTH_ACCESS_TOKEN_REQUEST_INCLUDE_CLIENT_ID = (
|
||||
os.environ.get("OAUTH_ACCESS_TOKEN_REQUEST_INCLUDE_CLIENT_ID", "False").lower()
|
||||
== "true"
|
||||
)
|
||||
|
||||
|
||||
def load_oauth_providers():
|
||||
OAUTH_PROVIDERS.clear()
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ from open_webui.config import (
|
|||
OAUTH_ADMIN_ROLES,
|
||||
OAUTH_ALLOWED_DOMAINS,
|
||||
OAUTH_UPDATE_PICTURE_ON_LOGIN,
|
||||
OAUTH_ACCESS_TOKEN_REQUEST_INCLUDE_CLIENT_ID,
|
||||
WEBHOOK_URL,
|
||||
JWT_EXPIRES_IN,
|
||||
AppConfig,
|
||||
|
|
@ -1273,8 +1274,12 @@ class OAuthManager:
|
|||
client = self.get_client(provider)
|
||||
|
||||
auth_params = {}
|
||||
|
||||
if client:
|
||||
if hasattr(client, "client_id"):
|
||||
if (
|
||||
hasattr(client, "client_id")
|
||||
and OAUTH_ACCESS_TOKEN_REQUEST_INCLUDE_CLIENT_ID
|
||||
):
|
||||
auth_params["client_id"] = client.client_id
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue