diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx b/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx index bc8364924e..d38a0250d3 100644 --- a/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx @@ -241,8 +241,8 @@ const BasePanel: FC = ({ // For trigger plugins, check if they have existing subscriptions (authenticated) const triggerProvider = useMemo(() => { if (data.type === BlockEnum.TriggerPlugin) { - if (data.provider_id && data.provider_name) - return `${data.provider_id}/${data.provider_name}` + if (data.provider_name) + return data.provider_name return data.provider_id || '' } return '' diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/node-auth-factory.tsx b/web/app/components/workflow/nodes/_base/components/workflow-panel/node-auth-factory.tsx index dc88888158..7ffc016b50 100644 --- a/web/app/components/workflow/nodes/_base/components/workflow-panel/node-auth-factory.tsx +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/node-auth-factory.tsx @@ -32,11 +32,8 @@ const NodeAuth: FC = ({ data, onAuthorizationChange }) => { const provider = useMemo(() => { if (data.type === BlockEnum.TriggerPlugin) { // If we have both plugin_id and provider_name, construct the full path - if (data.provider_id && data.provider_name) - return `${data.provider_id}/${data.provider_name}` - - // Otherwise use provider_id as fallback (might be already complete) - return data.provider_id || '' + if (data.provider_name) + return data.provider_name } return data.provider_id || '' }, [data.type, data.provider_id, data.provider_name]) diff --git a/web/app/components/workflow/nodes/trigger-plugin/components/api-key-config-modal.tsx b/web/app/components/workflow/nodes/trigger-plugin/components/api-key-config-modal.tsx index 48fc2e9116..59f6c18b86 100644 --- a/web/app/components/workflow/nodes/trigger-plugin/components/api-key-config-modal.tsx +++ b/web/app/components/workflow/nodes/trigger-plugin/components/api-key-config-modal.tsx @@ -46,8 +46,6 @@ const ApiKeyConfigModal: FC = ({ const buildSubscription = useBuildTriggerSubscription() const invalidateSubscriptions = useInvalidateTriggerSubscriptions() - const providerPath = `${provider.plugin_id}/${provider.name}` - useEffect(() => { if (provider.credentials_schema) { const schemas = toolCredentialToFormSchemas(provider.credentials_schema as any) @@ -85,7 +83,7 @@ const ApiKeyConfigModal: FC = ({ let builderId = subscriptionBuilderId if (!builderId) { const createResponse = await createBuilder.mutateAsync({ - provider: providerPath, + provider: provider.name, credentials: tempCredential, }) builderId = createResponse.subscription_builder.id @@ -94,7 +92,7 @@ const ApiKeyConfigModal: FC = ({ else { // Update existing builder await updateBuilder.mutateAsync({ - provider: providerPath, + provider: provider.name, subscriptionBuilderId: builderId, credentials: tempCredential, }) @@ -102,18 +100,18 @@ const ApiKeyConfigModal: FC = ({ // Step 2: Verify credentials await verifyBuilder.mutateAsync({ - provider: providerPath, + provider: provider.name, subscriptionBuilderId: builderId, }) // Step 3: Build final subscription await buildSubscription.mutateAsync({ - provider: providerPath, + provider: provider.name, subscriptionBuilderId: builderId, }) // Step 4: Invalidate and notify success - invalidateSubscriptions(providerPath) + invalidateSubscriptions(provider.name) notify({ type: 'success', message: t('workflow.nodes.triggerPlugin.apiKeyConfigured'), diff --git a/web/app/components/workflow/nodes/trigger-plugin/components/auth-method-selector.tsx b/web/app/components/workflow/nodes/trigger-plugin/components/auth-method-selector.tsx index 4ac4347095..12cf853d92 100644 --- a/web/app/components/workflow/nodes/trigger-plugin/components/auth-method-selector.tsx +++ b/web/app/components/workflow/nodes/trigger-plugin/components/auth-method-selector.tsx @@ -31,8 +31,7 @@ const AuthMethodSelector: FC = ({ const initiateTriggerOAuth = useInitiateTriggerOAuth() const invalidateSubscriptions = useInvalidateTriggerSubscriptions() - const providerPath = `${provider.plugin_id}/${provider.name}` - const { data: oauthConfig } = useTriggerOAuthConfig(providerPath, supportedMethods.includes('oauth')) + const { data: oauthConfig } = useTriggerOAuthConfig(provider.name, supportedMethods.includes('oauth')) const handleOAuthAuth = useCallback(async () => { // Check if OAuth client is configured @@ -43,10 +42,10 @@ const AuthMethodSelector: FC = ({ } try { - const response = await initiateTriggerOAuth.mutateAsync(providerPath) + const response = await initiateTriggerOAuth.mutateAsync(provider.name) if (response.authorization_url) { openOAuthPopup(response.authorization_url, (callbackData) => { - invalidateSubscriptions(providerPath) + invalidateSubscriptions(provider.name) if (callbackData?.success === false) { notify({ @@ -69,7 +68,7 @@ const AuthMethodSelector: FC = ({ message: t('workflow.nodes.triggerPlugin.oauthConfigFailed', { error: error.message }), }) } - }, [providerPath, initiateTriggerOAuth, invalidateSubscriptions, notify, oauthConfig]) + }, [provider.name, initiateTriggerOAuth, invalidateSubscriptions, notify, oauthConfig]) const handleApiKeyAuth = useCallback(() => { setShowApiKeyModal(true) @@ -135,7 +134,7 @@ const AuthMethodSelector: FC = ({ onCancel={() => setShowApiKeyModal(false)} onSuccess={() => { setShowApiKeyModal(false) - invalidateSubscriptions(providerPath) + invalidateSubscriptions(provider.name) }} /> )} diff --git a/web/app/components/workflow/nodes/trigger-plugin/use-config.ts b/web/app/components/workflow/nodes/trigger-plugin/use-config.ts index 4039793ddb..8ec8ff7c61 100644 --- a/web/app/components/workflow/nodes/trigger-plugin/use-config.ts +++ b/web/app/components/workflow/nodes/trigger-plugin/use-config.ts @@ -28,8 +28,7 @@ const useConfig = (id: string, payload: PluginTriggerNodeType) => { // Construct provider for authentication check const authProvider = useMemo(() => { - if (provider_id && provider_name) return `${provider_id}/${provider_name}` - return provider_id || '' + return provider_name || '' }, [provider_id, provider_name]) const { data: subscriptions = [] } = useTriggerSubscriptions(