mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
black fmt
This commit is contained in:
parent
ecbf74dbea
commit
4b74034967
1 changed files with 7 additions and 7 deletions
|
|
@ -486,9 +486,7 @@ class OAuthClientManager:
|
||||||
try:
|
try:
|
||||||
payload = json.loads(body_text)
|
payload = json.loads(body_text)
|
||||||
error = payload.get("error")
|
error = payload.get("error")
|
||||||
error_description = payload.get(
|
error_description = payload.get("error_description", "")
|
||||||
"error_description", ""
|
|
||||||
)
|
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
error = None
|
error = None
|
||||||
error_description = ""
|
error_description = ""
|
||||||
|
|
@ -496,7 +494,11 @@ class OAuthClientManager:
|
||||||
error_description = body_text
|
error_description = body_text
|
||||||
|
|
||||||
combined = f"{error or ''} {error_description}".lower()
|
combined = f"{error or ''} {error_description}".lower()
|
||||||
if "invalid_client" in combined or "invalid client" in combined or "client id" in combined:
|
if (
|
||||||
|
"invalid_client" in combined
|
||||||
|
or "invalid client" in combined
|
||||||
|
or "client id" in combined
|
||||||
|
):
|
||||||
log.warning(
|
log.warning(
|
||||||
"OAuth client preflight detected invalid registration for %s: %s %s",
|
"OAuth client preflight detected invalid registration for %s: %s %s",
|
||||||
client_info.client_id,
|
client_info.client_id,
|
||||||
|
|
@ -577,9 +579,7 @@ class OAuthClientManager:
|
||||||
log.info("Re-registered OAuth client %s for MCP tool server", client_id)
|
log.info("Re-registered OAuth client %s for MCP tool server", client_id)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def _ensure_valid_client_registration(
|
async def _ensure_valid_client_registration(self, request, client_id: str) -> None:
|
||||||
self, request, client_id: str
|
|
||||||
) -> None:
|
|
||||||
if not client_id.startswith("mcp:"):
|
if not client_id.startswith("mcp:"):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue