Skip to content

feat(api): /chat and /chat/<channel> sign into Slack via SSO - #185

Merged
themightychris merged 4 commits into
developfrom
feat/chat-sso-launch
Sep 18, 2026
Merged

themightychris merged 4 commits into
developfrom
feat/chat-sso-launch

Conversation

@themightychris

Copy link
Copy Markdown
Member

Restores the laddr behaviour behind the codeforphilly.org/chat/<channel> links distributed over the years. Plan: plans/chat-sso-launch.md.

What was wrong

  • /chat redirected to https://codeforphilly.slack.com/channels/<name> — fine if you already have a Slack session, useless otherwise.
  • /chat/<channel> (the shape of the links in the wild) fell through to the SPA's 404.

What laddr did

Emergence\Slack\Connector::handleLaunchRequest:

$channel = $_GET['channel'] ?? shiftPath() ?? 'general';
Site::redirect('https://'.teamHost.'/sso/saml/start?redir='.urlencode("/messages/$channel/"));

i.e. SP-initiated SSO: Slack sends the AuthnRequest to our IdP (/api/saml/slack/sso, verified live tonight), the member signs in here if needed, and Slack honours redir to open the channel.

Changes

  • specs/screens/chat.md: path form, SSO-start target, default general.
  • apps/api/src/routes/chat.ts: /chat, /chat/:channel, /chat/:channel/ (the app does not ignore trailing slashes globally), ?channel= kept for the project button; invalid/empty → general; host is always SLACK_TEAM_HOST.
  • Tests rewritten to the new target; path form, trailing slash, and host-safety cases added.

Validation

type-check, lint, chat suite 14/14. Live check after deploy: signed-out browser → /chat/general → CfP login → Slack opens in #general.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ

themightychris and others added 4 commits September 18, 2026 02:16
Match laddr: the redirect targets Slack's SP-initiated SSO start URL
with redir=/messages/<channel>/, so the member is signed in through our
IdP and lands in the channel. Years of codeforphilly.org/chat/<channel>
links depend on the path form; default channel is general.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
The rewrite's /chat pointed at https://<team>.slack.com/channels/<name>,
which assumes an existing Slack session, and /chat/<channel> fell
through to the SPA's 404. laddr's Emergence\Slack\Connector redirected
to Slack's SSO start with redir=/messages/<channel>/; Slack then drives
the SP-initiated flow against our IdP and opens the channel. Restore
that, accept the path form (with and without a trailing slash), and
default to general.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
@themightychris
themightychris merged commit 6bd3707 into develop Sep 18, 2026
1 check passed
@themightychris
themightychris deleted the feat/chat-sso-launch branch September 18, 2026 06:20
@themightychris themightychris mentioned this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant