export const auth = betterAuth({
databaseHooks: {
session: {
create: {
before: async (session) => {
const email = user.email
const orgs = orgs
const user_org = some logic to find the correct org based on email
return {
data: {
...session,
activeOrganizationId: user_org.id
}
}
}
}
}
}
});
export const auth = betterAuth({
databaseHooks: {
session: {
create: {
before: async (session) => {
const email = user.email
const orgs = orgs
const user_org = some logic to find the correct org based on email
return {
data: {
...session,
activeOrganizationId: user_org.id
}
}
}
}
}
}
});