T3 Stack · Concept
protectedProcedure
protectedProcedure is a reusable tRPC procedure that only allows authenticated users. It rejects missing sessions and exposes the signed-in user's ID to the procedure.
Last updated
Syntax
t.procedure.use(({ ctx, next }) => { ... })In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
NextAuth.jsSessionProvidergetServerAuthSessioncreateContextTRPCErrorPrisma