Email Verification Complete hook?

Hello, I am making a Nuxt 4 Application with Better-Auth and wanted to ask how can I create a Hook that will fire on Email Verification Successfully. I need it at a Point where the session is already established (or how would it be done) to insert Data to a custom table for my Application
Solution:
okey so I found this to be helpful: ```ts emailVerification: { sendVerificationEmail: async ({ user, url, token }, request) => { // send mail logic...
Jump to solution
1 Reply
Solution
claas.sh
claas.sh2mo ago
okey so I found this to be helpful:
emailVerification: {
sendVerificationEmail: async ({ user, url, token }, request) => {
// send mail logic
},
autoSignInAfterVerification: true,
afterEmailVerification: async (user, request) => {
// insert user data
}
},
emailAndPassword: {
requireEmailVerification: true
}
emailVerification: {
sendVerificationEmail: async ({ user, url, token }, request) => {
// send mail logic
},
autoSignInAfterVerification: true,
afterEmailVerification: async (user, request) => {
// insert user data
}
},
emailAndPassword: {
requireEmailVerification: true
}

Did you find this page helpful?