Follow-ups from impl-review (S-06)
F4 — Switch requireUser() (and all auth actions) from getUser() to getSession()
- Source: impl-review 2026-07-04, finding F4 (Pattern Consistency).
- Where:
src/lib/supabase/server.ts:49(requireUser), plus every action/page that callsauth.getUser()downstream of the proxy (src/app/(authenticated)/recipes/*,src/app/page.tsx,src/app/share/actions.ts, …). - Why:
context/foundation/lessons.mdrule #3 — downstream of proxy auth, preferauth.getSession()(cookie read, no network) overauth.getUser()(network round-trip). The bell adds two moregetUser()round-trips per interaction. - Scope: Repo-wide, NOT part of S-06. Deferred deliberately so this change stays focused; doing it here would touch unrelated call sites. Reserve
getUser()for the trust boundary (proxy) and API routes outside the proxy matcher. - Decision: Plan a separate cleanup change.