You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(slack): after Install to Workspace the browser is redirected to http://localhost when FRONTEND_URL is empty #3563
After Install to Workspace completes on Slack's side, the browser is sent to http://localhost/settings?slack=installed instead of back to the instance. The install itself succeeds (the workspace is stored), but the admin lands on a dead page and never sees the "✓ Workspace installed" confirmation.
This happens on any instance where the FRONTEND_URL environment variable is empty, which is what .env.example ships (FRONTEND_URL=). The same handler has just used the instance's Public URL setting to build the OAuth redirect URI, so it already knows the right address.
Instance with FRONTEND_URL unset and Public URL set in Settings.
Settings → Integrations → Slack Integration: save the OAuth credentials, connect Socket Mode.
Click Install to Workspace, approve on Slack.
Expected
The browser returns to <this instance>/settings?slack=installed and the card shows "✓ Workspace installed" with the workspace under Connected Workspaces.
Actual
Browser lands on http://localhost/settings.
Backend log, same request: Slack workspace <name> installed via Settings followed by ERROR services.slack_service: FRONTEND_URL not configured — OAuth redirect will fail. Set FRONTEND_URL in .env.
GET /api/settings/slack/status lists the workspace, so the install worked; only the return trip is wrong.
The per-agent flow (…/agents/{name}?tab=sharing&slack=connected) and both error redirects go through the same function, so they land on localhost too.
base_url=FRONTEND_URLifnotbase_url:
logger.error("FRONTEND_URL not configured — OAuth redirect will fail. Set FRONTEND_URL in .env")
base_url="http://localhost"
get_oauth_url / exchange_oauth_code in the same file build the redirect URI from get_public_chat_url(), which is set whenever this code path is reachable. src/backend/config.py: FRONTEND_URL = os.getenv("FRONTEND_URL", "").
Acceptance criteria
With FRONTEND_URL empty and Public URL set, a completed Slack install returns the browser to the instance's Settings page with ?slack=installed.
Same for the per-agent connect redirect and for both error redirects.
FRONTEND_URL, when set, keeps taking precedence.
The handler never redirects to http://localhost on an instance that has an advertised address; a unit test covers the empty-FRONTEND_URL case.
Activity
fix(slack): fall back to Public URL for OAuth callback redirect (#4167)