From 8a1ba0b36bfb649103cd3ec0068ecd633d7510b3 Mon Sep 17 00:00:00 2001 From: Multinite <145994855+Multinite@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:51:37 +1000 Subject: [PATCH] docs: fixed demo code error in concepts/plugins. (#641) --- docs/content/docs/concepts/plugins.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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