feat(core-shared): auth-gate mutating feature procedures
Adds a shared requireAuthenticated tRPC middleware (reads the server- resolved ctx.user from createTrpcContext) and applies it to every mutating feature procedure — blog.createArticle and media.deleteMedia were anonymous-callable (audit finding B7). Read-only queries stay public; features compose <x>ProtectedProcedure from their error-mapped base procedure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"./payload": "./src/payload/index.ts",
|
||||
"./trpc/init": "./src/trpc/init.ts",
|
||||
"./trpc/context": "./src/trpc/context.ts",
|
||||
"./trpc/require-authenticated": "./src/trpc/require-authenticated.ts",
|
||||
"./trpc/define-error-middleware": "./src/trpc/define-error-middleware.ts",
|
||||
"./instrumentation": "./src/instrumentation/index.ts",
|
||||
"./instrumentation/otel": "./src/instrumentation/otel/index.ts",
|
||||
|
||||
Reference in New Issue
Block a user