Bruh
Bruh
BABetter Auth
Created by Bruh on 5/8/2025 in #help
Database Hooks `before.create` Has Undefined Context
How is the context populated in the database before create hook? Taken from example here https://www.better-auth.com/docs/concepts/database#1-before-hook Code snippet below:
databaseHooks: {
session: {
create: {
before: async (session, context) => {
// context is always undefined here

return {
data: session
}
},
}
}
},
databaseHooks: {
session: {
create: {
before: async (session, context) => {
// context is always undefined here

return {
data: session
}
},
}
}
},
5 replies