nico/26-feb-26/fix-seed #4

Merged
nicoarya20 merged 2 commits from nico/26-feb-26/fix-seed into main 2026-02-26 16:31:22 +08:00
2 changed files with 23 additions and 1 deletions
Showing only changes of commit 226b0880e6 - Show all commits

View File

@@ -32,6 +32,23 @@ export const auth = betterAuth({
},
},
},
databaseHooks: {
user: {
create: {
before: async (user) => {
if (user.email === process.env.ADMIN_EMAIL) {
return {
data: {
...user,
role: "admin",
},
};
}
return { data: user };
},
},
},
},
secret: process.env.BETTER_AUTH_SECRET,
session: {
cookieCache: {
@@ -42,5 +59,6 @@ export const auth = betterAuth({
},
advanced: {
cookiePrefix: "bun-react",
trustProxy: true,
},
});