Email verification not working as I would expect

I have a pretty simple BetterAuth set up. I am just trying to do a simple emailSignUp with email verification flow. I followed the docs page on email sign up.

export const auth = betterAuth({
  emailVerification: {
    sendVerificationEmail: async ({ user, url, token }, request) => {
      console.log(
        "Sending verification email to:",
        user.email,
        "with token:",
        token,
        "url:",
        url
      );
      await sendEmail({
        to: user.email,
        subject: "Verify your email address",
        text: `Click the link to verify your email: ${url}`,
        html: `<p>Click the link to verify your email: <a href="${url}">${url}</a></p>`,
      });
    },
  },
  emailAndPassword: {
    requireEmailVerification: true,
    enabled: true,
  },
  database: drizzleAdapter(db, {
    provider: "pg", // or "mysql", "sqlite"
  }),
  plugins: [nextCookies()],
});


in my signUp server action I have this:
  const { error } = await tryCatch(
    auth.api.signUpEmail({
      body: {
        email,
        name: email,
        password,
      },
    })
  );


I receive the email just fine, with the token:
Click the link to verify your email: http://localhost:3000/api/auth/verify-email?token=eyJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImxramFkc2ZAYXNkZi5jb20iLCJpYXQiOjE3NDcxNDQ3NDEsImV4cCI6MTc0NzE0ODM0MX0.4q3y1JxTFGK4joYJrsat-2sTZRj3vAY05PnaonYogXk&callbackURL=/

When I click on that link, I get the attached screenshot int he network tab.

No errors, no feedback.

No entries in my mytable_verifications either. The signUp creates an account, and I can sign in with that account right away.
image.png
Was this page helpful?