Repository navigation
fix(routes): serve both the Instagram and TikTok OAuth callbacks - #174
Merged
Merged
Conversation
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.
|
Architecture Data flow Review ✨ Nothing flagged · reviewed Tip Run 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
There was a problem hiding this comment.
✅ 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.tsandsrc/routes/social/tiktok/callback.get.tseach setnamethrough@ApplyOptions, so the store no longer unloads one when the other loads. - Explicit
routeandmethods— Required once a route has its own name: theRouteconstructor only derives path and method from the piece name whenoptions.routeis unset. The paths keep the same prefix handling, so the registered redirect URIs stay valid. - Regression test —
tests/routes/socialCallbacks.test.tsinserts both into a realRouteStoreand asserts the router resolves each path. It passes locally afterpnpm prisma:generate. - Docs —
AGENTS.mdrecords 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.
claude-sonnet-5-5 | 𝕏
This was referenced Nov 17, 2026
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.

🔗 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/callbackanswered 404, so an owner who authorized TikTok could never finish connecting. Which one is lost depends on the load order.📚 Description
namewith@ApplyOptions:instagram-callbackandtiktok-callback.routeandmethods: ["GET"]. The public URLs do not change, and the redirect URIs registered with Instagram and TikTok stay valid.tests/routes/socialCallbacks.test.tsloads both into a realRouteStoreand asks the router for each path. It failed before the change.AGENTS.mdrecords the rule, since nothing else warns about it.