Skip to content

bug(slack): after Install to Workspace the browser is redirected to http://localhost when FRONTEND_URL is empty #3563

Closed

Description

@obasilakis

Summary

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.

Build + row

  • Build: v1.0.0-rc2 (96f88f982)
  • Release-test row: B18 (Channels — Slack, Telegram, WhatsApp)

Steps

  1. Instance with FRONTEND_URL unset and Public URL set in Settings.
  2. Settings → Integrations → Slack Integration: save the OAuth credentials, connect Socket Mode.
  3. 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.

Where

src/backend/services/slack_service.py — SlackService.get_oauth_callback_redirect:

base_url = FRONTEND_URL
if not base_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

  1. added
    priority-p3
    type-bug
    complexity-low
    on Oct 11, 2026
  2. added
    status-ready
    theme-channels
    on Oct 12, 2026
  3. added
    status-in-progress
    and removed
    status-ready
    on Nov 3, 2026
  4. added
    status-in-dev
    and removed
    status-in-progress
    on Nov 3, 2026
  5. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p3theme-channelstype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions