export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg", // or "mysql", "sqlite"
usePlural: true,
}),
secret: process.env.BETTER_AUTH_SECRET,
trustedOrigins: ["http://localhost:3001"],
emailAndPassword: {
enabled: true,
},
user: {
changeEmail: {
enabled: true,
sendChangeEmailVerification: async (
{ user, newEmail, url, token },
request,
) => {
console.log("sendChangeEmailVerification", user, newEmail, url, token);
},
},
},
plugins: [
organization({
...
}),
],
});
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg", // or "mysql", "sqlite"
usePlural: true,
}),
secret: process.env.BETTER_AUTH_SECRET,
trustedOrigins: ["http://localhost:3001"],
emailAndPassword: {
enabled: true,
},
user: {
changeEmail: {
enabled: true,
sendChangeEmailVerification: async (
{ user, newEmail, url, token },
request,
) => {
console.log("sendChangeEmailVerification", user, newEmail, url, token);
},
},
},
plugins: [
organization({
...
}),
],
});