mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
chore: upgrade better-call version
This commit is contained in:
@@ -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.
|
YOu should use hooks when you need to hook into to a specific endpoint or request for more precise control.
|
||||||
|
|
||||||
```ts title="plugin.ts"
|
```ts title="plugin.ts"
|
||||||
|
import { createAuthMiddleware } from "better-auth/plugins";
|
||||||
|
|
||||||
const myPlugin = {
|
const myPlugin = {
|
||||||
id: "my-plugin",
|
id: "my-plugin",
|
||||||
hooks: {
|
hooks: {
|
||||||
@@ -238,16 +240,16 @@ const myPlugin = {
|
|||||||
matcher: (context)=>{
|
matcher: (context)=>{
|
||||||
return context.req.method === "POST"
|
return context.req.method === "POST"
|
||||||
},
|
},
|
||||||
handler: createAuthMiddelware(async(ctx)=>{
|
handler: createAuthMiddleware(async(ctx)=>{
|
||||||
//do something before the request
|
//do something before the request
|
||||||
})
|
})
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
after: [{
|
after: [{
|
||||||
matcher: (context)=>{
|
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
|
//this is the returned response object from the actual endpoint
|
||||||
const returned = ctx.context.returned
|
const returned = ctx.context.returned
|
||||||
//do something after the request
|
//do something after the request
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
"@simplewebauthn/browser": "^10.0.0",
|
"@simplewebauthn/browser": "^10.0.0",
|
||||||
"@simplewebauthn/server": "^10.0.1",
|
"@simplewebauthn/server": "^10.0.1",
|
||||||
"arctic": "2.0.0-next.9",
|
"arctic": "2.0.0-next.9",
|
||||||
"better-call": "0.2.5-beta.4",
|
"better-call": "0.2.5-beta.5",
|
||||||
"c12": "^1.11.2",
|
"c12": "^1.11.2",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
|
|||||||
32086
pnpm-lock.yaml
generated
32086
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user