fix: refersh cookie cache properly when it's expired (#909)

This commit is contained in:
Bereket Engida
2024-12-16 16:53:01 +03:00
committed by GitHub
parent 69b804cfbc
commit caf0cf9cf7
4 changed files with 87 additions and 29 deletions

View File

@@ -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({