Memo engagement UI (endorse / critique) with LinkedIn sign-in#37
Merged
Conversation
xrendan
force-pushed
the
feature/memo-engagement-users
branch
2 times, most recently
from
July 21, 2026 02:32
4948e6a to
5bfc1fa
Compare
Evolves jnmclarty's frontend from the direct LinkedIn-payload approach to real OAuth: readers sign in through York Factory's Doorkeeper (LinkedIn), tokens live in httpOnly cookies, and engagement writes go through server-side proxy routes (/api/memos/[slug]/engagement, /api/profile/postal) with the Bearer token kept off the client. Adds getCurrentUser resolving the reader from /me, the postal- code profile step when an account isn't engagement-ready, and /api/revalidate ISR cache-busting.
xrendan
force-pushed
the
feature/memo-engagement-users
branch
from
July 21, 2026 02:43
5bfc1fa to
6985db8
Compare
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.
Summary
Frontend for reader memo engagement. Readers sign in through York Factory's OAuth (LinkedIn) and can endorse or critique a memo from its page. Pairs with the York Factory PR of the same branch name (BuildCanada/york_factory#74).
How it works
/api/auth/login→ York Factory/oauth/authorize(LinkedIn) → back to/api/auth/callback, which exchanges the code for tokens stored as httpOnly cookies.getCurrentUserresolves the signed-in reader from York Factory/me(React.cache-deduped per request, never cross-request)./api/memos/[slug]/engagement,/api/profile/postal) which forward to York Factory with the Bearer token — the token never reaches the browser./api/revalidatebusts the memo's ISR cache when counts change (sharedREVALIDATE_SECRET).Next.js 16 fix (second commit)
Next 16 renamed the edge entrypoint
middleware.ts→proxy.tsand refuses to boot with both present. This branch had both, with different logic (proxy = PostHog/dashboardgating, middleware = OAuth token refresh). Merged into a singleproxy()that dispatches by path and unions the matchers, and deletedmiddleware.ts.Testing
Verified the full loop live against a local York Factory (this branch): sign in with LinkedIn → return authenticated → "Endorse this memo" saves the postal code and writes a real endorsement (
POST /api/memos/…/engagement→201), engagement count updates. Lint clean on changed files.