Error Changing user email in server from client (URGENT) EXPRESS JS

when i invoke change email from my client const UpdateEmail = await axios.post("/api/auth/change-email", { newEmail:values.email }, { withCredentials:true ,baseURL:process.env.NEXT_PUBLIC_SERVER_URL});
am always getting this response from the server 2025-10-03T18:07:31.879Z ERROR [Better Auth]: Verification email isn't enabled. email verification is set to true in my servers betterauth config emailVerification: { enabled: true, sendVerificationEmail: async ({ user, url, token }, request) => { await sendEmail({ to: user.email, subject: "Aqunest - Verify your email address", text: Click the link to verify your email: ${url}, url, buttonText: Verify Email }); } }, user: { changeEmail: { enabled: true, sendVerificationEmail: async ({ user, newEmail, url, token }, request) => { await sendEmail({ to: newEmail, // ✅ always new email subject: "Aqunest - Verify your new email address", text: Click the link to verify your new email: ${url}, url, buttonText: Verify Email }); } },
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?