mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 12:27:44 +00:00
fix: refersh cookie cache properly when it's expired (#909)
This commit is contained in:
@@ -42,6 +42,22 @@ export const auth = betterAuth({
|
||||
dialect,
|
||||
type: process.env.USE_MYSQL ? "mysql" : "sqlite",
|
||||
},
|
||||
databaseHooks: {
|
||||
user: {
|
||||
update: {
|
||||
async before(user) {
|
||||
if (user.emailVerified) {
|
||||
return {
|
||||
data: {
|
||||
...user,
|
||||
emailVerifiedAt: new Date().toISOString(),
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
emailVerification: {
|
||||
async sendVerificationEmail({ user, url }) {
|
||||
const res = await resend.emails.send({
|
||||
|
||||
Reference in New Issue
Block a user