From 17cc49dede64e57b1692bfb3c9e99c91d74ea202 Mon Sep 17 00:00:00 2001 From: "tianhaotian.3" Date: Fri, 17 Apr 2026 17:33:42 +0800 Subject: [PATCH] fix(wecom): correct auth_provider_registry import path and call signature The WeCom callback imported `auth_provider_registry` from `app.services.auth_provider`, but it lives in `app.services.auth_registry`. Additionally, the call `get_provider(provider)` passed an IdentityProvider object instead of the expected `(db, provider_type, tenant_id)` signature, and was missing `await`. --- backend/app/api/wecom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/api/wecom.py b/backend/app/api/wecom.py index 8aaa30469..8ee10e078 100644 --- a/backend/app/api/wecom.py +++ b/backend/app/api/wecom.py @@ -32,7 +32,7 @@ from app.models.identity import IdentityProvider, SSOScanSession from app.models.user import User from app.services.activity_logger import log_activity -from app.services.auth_provider import auth_provider_registry +from app.services.auth_registry import auth_provider_registry from app.services.channel_session import find_or_create_channel_session from app.services.channel_user_service import channel_user_service from app.services.platform_service import platform_service @@ -686,7 +686,7 @@ async def wecom_callback( # 2. Extract user info and login/register via RegistrationService try: - auth_provider = auth_provider_registry.get_provider(provider) + auth_provider = await auth_provider_registry.get_provider(db, "wecom", str(tenant_id) if tenant_id else None) token_data = await auth_provider.exchange_code_for_token(code) access_token_str = token_data.get("access_token")