Auth

Implement JWT/cookie authentication and authorization in tRPC using createContext for user extraction, t.middleware with opts.next({ ctx }) for context narrowing to non-null user, protectedProcedure base pattern, client-side Authorization headers via httpBatchLink headers(), WebSocket connectionParams, and SSE auth via cookies or EventSource polyfill custom headers.

trpc 3a5e690 7.8 KB Updated

File contents

trpc/trpc/tree/main/packages/server/skills/auth commit 3a5e6901c8

Frequently asked questions

npx skillmds add trpc/auth