Repository navigation
Discord bot (1/2): server integration endpoints + account linking - #187
Merged
Merged
Conversation
Add the server + client pieces the Discord bot (ticket 2) will consume:
- DiscordLink model ({ discordId unique, userId, createdAt }), upsert on re-link
- bot-API-key middleware, wired ONLY onto /api/integrations/discord/* routes
- POST /api/integrations/discord/link-token (bot key) — mint a short-lived,
single-purpose token bound to a Discord ID, signed with a key derived from
JWT_SECRET so it is not interchangeable with the auth cookie JWT
- POST /api/integrations/discord/link (user cookie) — verify token + cookie,
upsert the mapping
- POST /api/integrations/discord/rooms (bot key) — create an instant room hosted
by the linked user; unknown Discord ID returns a distinct not_linked 404
- client /link/discord confirmation page (behind ProtectedRoute) + api helper
- zod-equivalent Joi validation matching existing conventions; env + .env.example
Closes #185
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
pino-http serializes request headers, so the host-grade X-Bot-Api-Key would otherwise leak into request-completion log lines. Add it to REDACT_PATHS and add a behavioural test proving the value is censored (not just config membership).
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ticket #185 — the server + client pieces the Discord bot (ticket #186) will consume. Spec: `docs/specs/2026-07-23-discord-bot-design.md`.
What's here
Tests (strict TDD)
Notes / deviations
Closes #185