- {typeConnectors.map((connector) => {
- const isIndexing = indexingConnectorIds.has(connector.id);
- const isAuthExpired = !!reauthEndpoint && connector.config?.auth_expired === true;
+ {typeConnectors.map((connector) => {
+ const isIndexing = indexingConnectorIds.has(connector.id);
+ const connectorReauthEndpoint = getReauthEndpoint(connector);
+ const isAuthExpired = !!connectorReauthEndpoint && connector.config?.auth_expired === true;
+ const isLive = LIVE_CONNECTOR_TYPES.has(connector.connector_type) || Boolean(connector.config?.server_config);
return (
= ({
Syncing
- ) : !isLiveConnector(connector.connector_type) ? (
+ ) : !isLive ? (
{connector.last_indexed_at
? `Last indexed: ${formatRelativeDate(connector.last_indexed_at)}`
@@ -239,28 +225,73 @@ export const ConnectorAccountsListView: FC = ({
) : null}
- {isAuthExpired ? (
-
+ {isAuthExpired ? (
+
+ ) : isLive && onDisconnect ? (
+ confirmDisconnectId === connector.id ? (
+
+
+
+
) : (
- )}
+ )
+ ) : (
+
+ )}
);
})}
diff --git a/surfsense_web/components/tool-ui/generic-hitl-approval.tsx b/surfsense_web/components/tool-ui/generic-hitl-approval.tsx
index 809b76c38..d21f249ee 100644
--- a/surfsense_web/components/tool-ui/generic-hitl-approval.tsx
+++ b/surfsense_web/components/tool-ui/generic-hitl-approval.tsx
@@ -3,6 +3,7 @@
import type { ToolCallMessagePartComponent } from "@assistant-ui/react";
import { CornerDownLeftIcon, Pen } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
+import { toast } from "sonner";
import { TextShimmerLoader } from "@/components/prompt-kit/loader";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
@@ -116,8 +117,8 @@ function GenericApprovalCard({
if (phase !== "pending" || !isMCPTool) return;
setProcessing();
onDecision({ type: "approve" });
- connectorsApiService.trustMCPTool(mcpConnectorId, toolName).catch((err) => {
- console.error("Failed to trust MCP tool:", err);
+ connectorsApiService.trustMCPTool(mcpConnectorId, toolName).catch(() => {
+ toast.error("Failed to save 'Always Allow' preference. The tool will still require approval next time.");
});
}, [phase, setProcessing, onDecision, isMCPTool, mcpConnectorId, toolName]);
diff --git a/surfsense_web/lib/apis/connectors-api.service.ts b/surfsense_web/lib/apis/connectors-api.service.ts
index 3eaa767c5..f4137c787 100644
--- a/surfsense_web/lib/apis/connectors-api.service.ts
+++ b/surfsense_web/lib/apis/connectors-api.service.ts
@@ -414,16 +414,8 @@ class ConnectorsApiService {
* Subsequent calls to this tool will skip HITL approval.
*/
trustMCPTool = async (connectorId: number, toolName: string): Promise