diff --git a/frontend-modern/src/components/Settings/UnifiedAgents.tsx b/frontend-modern/src/components/Settings/UnifiedAgents.tsx index c68293213..85ed9f516 100644 --- a/frontend-modern/src/components/Settings/UnifiedAgents.tsx +++ b/frontend-modern/src/components/Settings/UnifiedAgents.tsx @@ -247,7 +247,9 @@ export const UnifiedAgents: Component = () => { const getUninstallCommand = () => { const url = customAgentUrl() || agentUrl(); - return `curl ${getCurlInsecureFlag()}-fsSL ${url}/install.sh | bash -s -- --uninstall`; + const token = currentToken() || latestRecord()?.id || TOKEN_PLACEHOLDER; + const insecure = insecureMode() ? ' --insecure' : ''; + return `curl ${getCurlInsecureFlag()}-fsSL ${url}/install.sh | bash -s -- --uninstall --url ${url} --token ${token}${insecure}`; }; // Track previously seen host types to prevent flapping when one source temporarily has no data @@ -1023,8 +1025,7 @@ export const UnifiedAgents: Component = () => {