diff --git a/docs/content/docs/concepts/plugins.mdx b/docs/content/docs/concepts/plugins.mdx index 264b52be6f..c94cfbc14b 100644 --- a/docs/content/docs/concepts/plugins.mdx +++ b/docs/content/docs/concepts/plugins.mdx @@ -194,8 +194,7 @@ import { createAuthMiddleware } from "better-auth/plugins"; const myPlugin = { id: "my-plugin", hooks: { - before: { - [{ + before: [{ matcher: (context)=>{ return context.headers.get("x-my-header") === "my-value" }, @@ -205,8 +204,7 @@ const myPlugin = { context: ctx // if you want to modify the context } }) - }] - }, + }], after: [{ matcher: (context)=>{ return context.req.method === "POST