EmailOTP sending verification email for link on signup.

@Better Auth Hey, so im trying to let the user choose between otp and link verification but when using the emailotp plugin, no matter the configuration it still sends an email with a verification link (not the otp code).

export const auth = betterAuth({
  database: drizzleAdapter(db, {
    provider: "pg",
    schema: schema,
    usePlural: true,
  }),
  emailAndPassword: {
    enabled: true,
    requireEmailVerification: true,
  },
  user: {
    additionalFields: {
      currentRole: { type: "string", input: true, returned: true },
    },
  },
  session: {
    cookieCache: { enabled: true, maxAge: 5 * 60 },
  },
  emailVerification: {
    sendOnSignUp: false,
    autoSignInAfterVerification: true,
    sendVerificationEmail: sendVerificationEmail,
    onEmailVerification: handleVerification,
  },
  plugins: [
    nextCookies(),
    emailOTP({
      sendVerificationOnSignUp: false,
      overrideDefaultEmailVerification: true,
      async sendVerificationOTP(data) {
        return await handleOTP(data);
      },
    }),
    customSession(handleCustomSession),
  ],
});

Currently it executes sendVerificationEmail on signup even though sendVerificationOnSignup is disabled in both the plugin and the emailVerification. Am i missing something here?
Was this page helpful?