chore: upgrade better-call version

This commit is contained in:
Bereket Engida
2024-10-10 13:55:21 +03:00
parent d2abe6d10d
commit c7f6d2530f
3 changed files with 17410 additions and 14686 deletions

View File

@@ -230,6 +230,8 @@ Hooks are similar to middlewares, as well as the `onRequest` and `onResponse` fu
YOu should use hooks when you need to hook into to a specific endpoint or request for more precise control.
```ts title="plugin.ts"
import { createAuthMiddleware } from "better-auth/plugins";
const myPlugin = {
id: "my-plugin",
hooks: {
@@ -238,16 +240,16 @@ const myPlugin = {
matcher: (context)=>{
return context.req.method === "POST"
},
handler: createAuthMiddelware(async(ctx)=>{
handler: createAuthMiddleware(async(ctx)=>{
//do something before the request
})
}]
},
after: [{
matcher: (context)=>{
return context.req.method === "POST"
return context.req.method === "POST
},
handler: createAuthMiddelware(async(ctx)=>{
handler: createAuthMiddleware(async(ctx)=>{
//this is the returned response object from the actual endpoint
const returned = ctx.context.returned
//do something after the request

View File

@@ -93,7 +93,7 @@
"@simplewebauthn/browser": "^10.0.0",
"@simplewebauthn/server": "^10.0.1",
"arctic": "2.0.0-next.9",
"better-call": "0.2.5-beta.4",
"better-call": "0.2.5-beta.5",
"c12": "^1.11.2",
"chalk": "^5.3.0",
"commander": "^12.1.0",

32086
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff