diff --git a/recipes/authorization.md b/recipes/authorization.md index ccdeb4c..2bbf89c 100644 --- a/recipes/authorization.md +++ b/recipes/authorization.md @@ -2,7 +2,7 @@ The `createContext`-function is called for each incoming request so here you can add contextual information about the calling user from the request object. -## Create context from request headers +### Create context from request headers ```ts // ~/server/trpc/index.ts @@ -35,7 +35,7 @@ type Context = trpc.inferAsyncReturnType // [..] Define API handler and app router ``` -## Option 1: Authorize using resolver +### Option 1: Authorize using resolver ```ts export const router = trpc @@ -60,7 +60,7 @@ export const router = trpc }) ``` -## Option 2: Authorize using middleware +### Option 2: Authorize using middleware ```ts import * as trpc from '@trpc/server' diff --git a/recipes/validation.md b/recipes/validation.md index 99856fb..dd810f1 100644 --- a/recipes/validation.md +++ b/recipes/validation.md @@ -2,7 +2,7 @@ tRPC works out-of-the-box with yup/superstruct/zod/myzod/custom validators. -## Input Validation +### Input Validation ```ts // ~/server/trpc/index.ts @@ -24,7 +24,7 @@ export const router = trpc }) ``` -## Output Validation +### Output Validation ```ts // ~/server/trpc/index.ts