hunita
hunita
BABetter Auth
Created by Kenny on 3/20/2025 in #help
Custom Fields in Organization Table Not Saving Values
Hi, I have a similar issue. I've created my organizations with additionalFields but will not have access to them neither on the client with useActiveOrganization nor on the server when using organization.getFullOrganization
6 replies
BABetter Auth
Created by hunita on 3/19/2025 in #help
create organization in databaseHooks.user.create.after
thank you!
7 replies
BABetter Auth
Created by hunita on 3/19/2025 in #help
create organization in databaseHooks.user.create.after
Thank you for the replies! I'm not sure if I'm missing something, but since the hook si defined inside the auth instantiation options, I cannot call auth.api.createOrganization from within, can I?
const auth = betterAuth({
// ...
databaseHooks: {
user: {
create: {
after: async (user) => {
auth.api.createOrganization({ ... })
// ^^^^
}
}
}
},
// ...
})
const auth = betterAuth({
// ...
databaseHooks: {
user: {
create: {
after: async (user) => {
auth.api.createOrganization({ ... })
// ^^^^
}
}
}
},
// ...
})
7 replies