Issue 554
Research: single sign-on and sync between the site and the forum (or Discord)
Back to our planOpen
documentationauthpriority: medium
Summary
Short research before building the second half of #553: how members use their one Sprecher East login on the neighborhood forum (or Discord), and how the two stay in step. It picks the approach, writes it in a decision record and confirms the sub-issues. Social sign-in libraries were already compared (PR #261, record 0016-social-sign-in in PR #505), so that isn't repeated.
Decided 2026-11-01: the forum (Discourse) only; Discord is out of scope (#553).
Starting points
- Forum: DiscourseConnect, opens in a new tab is a core feature, opens in a new tab on our self-hosted forum.
- Our routes: PR #505 (
src/app/(frontend)/auth/[provider]/,src/modules/accounts/data/oauthProviders.ts,openid-client). - Jobs:
src/platform/payload/jobRunners.ts, decision 0011.
What to do (native-first ladder: one line per step, with link and reason)
- Native: what the forum offers out of the box; what Payload and Next.js give (jobs, hooks, routes,
node:crypto). - Official plugins: Discourse's own (DiscourseConnect; the OpenID Connect plugin as the alternative); Payload has none (record 0016).
- Established open source: e.g. an npm DiscourseConnect helper;
discord.jsvs plainfetch. Check against the package rules indocs/guidelines/security.md. Prefer no new package under ~50 lines withnode:crypto. - Our code: only what's left, in the owning module.
Then answer, for the chosen branch:
- Forum: settings the owner turns on; fields we send (nonce, email,
external_id, name,require_activation, groups); how the request is signed and checked,return_sso_urllimited to the forum; which admin API calls push changes and the key's scope; what happens to existing forum accounts (matched by email); what members see when the site is down. - Sync design: (site is source of truth; job after save; retries; periodic check; unlink, lost residency, account deletion #310); privacy (every field stored or sent, and why); secret names for
.env.localvia aninfraissue; confirm it's free.
Output
- A decision record (Status: Proposed) in a docs-only PR, using the next free number (
mainhas 0016; PR #505 also adds a 0016). - A comment here with the ladder lines, and #553's sub-issue sizes/blockers confirmed or corrected (nothing bigger than L).
- Any genuine product trade-off goes to the owner as one plain question with a recommendation.
Acceptance criteria
- Not done: Each ladder step is answered with a link and a reason.
- Not done: A clear recommendation for login and sync, with failure behavior and every stored or sent field listed.
- Not done: The decision record PR is open and #553's table matches.
- Not done: No product code changes.
Generated by Claude Code, opens in a new tab