docs: fixed demo code error in concepts/plugins. (#641)

This commit is contained in:
Multinite
2024-11-24 15:51:37 +10:00
committed by GitHub
parent b58c17b621
commit 8a1ba0b36b

View File

@@ -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