diff --git a/docs/content/docs/concepts/hooks.mdx b/docs/content/docs/concepts/hooks.mdx index 3c2cf51040..c51c406751 100644 --- a/docs/content/docs/concepts/hooks.mdx +++ b/docs/content/docs/concepts/hooks.mdx @@ -184,6 +184,26 @@ createAuthMiddleware(async (ctx) => { }); ``` +#### Returned + +The returned value from the hook is passed to the next hook in the chain. + +```ts title="auth.ts" +createAuthMiddleware(async (ctx) => { + const returned = ctx.context.returned; //this could be a successful response or an APIError +}); +``` + +#### Response Headers + +The response headers added by endpoints and hooks that run before this hook. + +```ts title="auth.ts" +createAuthMiddleware(async (ctx) => { + const responseHeaders = ctx.context.responseHeaders; +}); +``` + #### Predefined Auth Cookies Access BetterAuth’s predefined cookie properties: