From 3c5bf6c83c48fe024df27b8c692866f8b8db29ba Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:28:38 +0530 Subject: [PATCH] refactor: simplify Slack client initialization by directly passing the token --- .../app/routes/slack_add_connector_route.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/surfsense_backend/app/routes/slack_add_connector_route.py b/surfsense_backend/app/routes/slack_add_connector_route.py index 66ba1cd41..8523d14a5 100644 --- a/surfsense_backend/app/routes/slack_add_connector_route.py +++ b/surfsense_backend/app/routes/slack_add_connector_route.py @@ -582,14 +582,8 @@ async def get_slack_channels( # Import SlackHistory here to avoid circular imports from app.connectors.slack_history import SlackHistory - # Create Slack client and fetch channels - slack_client = SlackHistory( - session=session, - connector_id=connector_id, - credentials=credentials, - ) - # Set the decrypted token directly - slack_client.set_token(bot_token) + # Create Slack client with direct token (simple pattern for quick operations) + slack_client = SlackHistory(token=bot_token) channels = await slack_client.get_all_channels(include_private=True)