Skip to content

fix(routes): serve both the Instagram and TikTok OAuth callbacks - #174

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
fix/oauth-callback-route-names
Nov 17, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
fix/oauth-callback-route-names

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

Found while building the guild API (#173). No issue was open for it.

🧭 Context

The Instagram and TikTok OAuth callbacks are both callback.get.ts. A route piece is stored under its file name, and the store unloads a piece when another one with the same name arrives. Only the callback loaded last was served. Running Staryl locally, /social/tiktok/callback answered 404, so an owner who authorized TikTok could never finish connecting. Which one is lost depends on the load order.

📚 Description

  • Each callback sets its own name with @ApplyOptions: instagram-callback and tiktok-callback.
  • A route with its own name no longer takes its path and method from its file, so each one also sets route and methods: ["GET"]. The public URLs do not change, and the redirect URIs registered with Instagram and TikTok stay valid.
  • tests/routes/socialCallbacks.test.ts loads both into a real RouteStore and asks the router for each path. It failed before the change.
  • AGENTS.md records the rule, since nothing else warns about it.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. AI open source policy.


Read this PR faster    Follow each request

Both OAuth callbacks are callback.get.ts. A route piece is stored under
its file name, and the store unloads a piece when another with the same
name is inserted, so only the one loaded last was served. Locally the
TikTok callback answered 404, and an owner could never finish connecting.

Each callback now sets its own name, and with it its route and method,
which a named route no longer takes from its file.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Architecture

Walkthrough of Disambiguate OAuth callback route piece names, in three steps

Read this PR faster


Data flow

Data flow diagram for wolfstar-project/staryl at 623b4a4

Follow each request


Review

✨ Nothing flagged · reviewed 623b4a4


Tip

Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."

🪧 More tips
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the single commit on fix/oauth-callback-route-names, read end to end against the plugin-api Route and RouteStore implementation.

  • Unique piece names — src/routes/social/instagram/callback.get.ts and src/routes/social/tiktok/callback.get.ts each set name through @ApplyOptions, so the store no longer unloads one when the other loads.
  • Explicit route and methods — Required once a route has its own name: the Route constructor only derives path and method from the piece name when options.route is unset. The paths keep the same prefix handling, so the registered redirect URIs stay valid.
  • Regression test — tests/routes/socialCallbacks.test.ts inserts both into a real RouteStore and asserts the router resolves each path. It passes locally after pnpm prisma:generate.
  • Docs — AGENTS.md records the same-file-name rule.

I checked the other route files (notifications.get/patch, websub.get/post, and so on). Their names are already distinct, so there are no further collisions.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kodiakhq
kodiakhq Bot merged commit a49059c into main Nov 17, 2026
12 checks passed
@kodiakhq
kodiakhq Bot deleted the fix/oauth-callback-route-names branch November 17, 2026 15:31
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