Compare commits
4 Commits
nico/26-fe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 458f8f56e9 | |||
| 226b0880e6 | |||
| f355e5a5a3 | |||
| 2b4dd1b7a4 |
@@ -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,
|
secret: process.env.BETTER_AUTH_SECRET,
|
||||||
session: {
|
session: {
|
||||||
cookieCache: {
|
cookieCache: {
|
||||||
@@ -42,5 +59,6 @@ export const auth = betterAuth({
|
|||||||
},
|
},
|
||||||
advanced: {
|
advanced: {
|
||||||
cookiePrefix: "bun-react",
|
cookiePrefix: "bun-react",
|
||||||
|
trustProxy: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user