[GH-ISSUE #1050] I want to display the message "Verification is not complete. #8567

Closed
opened 2026-04-13 03:41:10 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @ngadceser on GitHub (Dec 28, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1050

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Hello, This is part of the example that I wrote.

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: 'mongodb',
}),
plugins: [nextCookies(), openAPI()],
emailAndPassword: {
enabled: true,
requireEmailVerification: true,
},

const response = await auth.api.signInEmail({
body: {
email: "",
password: ""
},
asResponse: true
})

For users who repeatedly attempt to sign-in without clicking the verification link
after sign-up,
the current behavior is to resend the verification email infinitely
every time a login attempt is made.

The functionality I want to implement is to simply display a message
like "Verification is not complete" instead of automatically resending the email.

const response = wait auth.api.signInEmail()
There is also a way to check in DB before doing it, but by any chance

Is there an option I might not be aware of to achieve this?
Thank you in advance!

Current vs. Expected behavior

I just want to show you the message, "The verification is not complete."

What version of Better Auth are you using?

1.1.3

Provide environment information

- OS: Windows11
-

Which area(s) are affected? (Select all that apply)

Other

Auth config (if applicable)

export const auth = betterAuth({
  database: prismaAdapter(prisma, {
    provider: 'mongodb',
  }),
  plugins: [nextCookies(), openAPI()],
  emailAndPassword: {
    enabled: true,
    requireEmailVerification: true,
  },
  emailVerification: {
    sendOnSignUp: true,
    autoSignInAfterVerification: true,
    sendVerificationEmail: async ({ user, token }) => {
      const verificationUrl = `${process.env.BETTER_AUTH_URL}/api/auth/verify-email?token=${token}&callbackURL=${process.env.EMAIL_VERIFICATION_CALLBACK_URL}`;
      // Send the verification email here
      await mailer.sendMail({
        from: process.env.EMAIL_FROM ?? 'admin@localhost',
        to: user.email,
        subject: 'Verify your email address',
        html: `<p>Click the following link to verify your email address:</p>
                 <p><a href="${verificationUrl}">Verify Link</a></p>`,
      });
    },
  },
} satisfies BetterAuthOptions);
export type Session = typeof auth.$Infer.Session;

Additional context

...

Originally created by @ngadceser on GitHub (Dec 28, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1050 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce Hello, This is part of the example that I wrote. --- export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: 'mongodb', }), plugins: [nextCookies(), openAPI()], emailAndPassword: { enabled: true, requireEmailVerification: true, }, --- const response = await auth.api.signInEmail({ body: { email: "", password: "" }, asResponse: true }) --- For users who repeatedly attempt to sign-in without clicking the verification link after sign-up, the current behavior is to resend the verification email infinitely every time a login attempt is made. The functionality I want to implement is to simply display a message like "Verification is not complete" instead of automatically resending the email. const response = wait auth.api.signInEmail() There is also a way to check in DB before doing it, but by any chance Is there an option I might not be aware of to achieve this? Thank you in advance! ### Current vs. Expected behavior I just want to show you the message, "The verification is not complete." ### What version of Better Auth are you using? 1.1.3 ### Provide environment information ```bash - OS: Windows11 - ``` ### Which area(s) are affected? (Select all that apply) Other ### Auth config (if applicable) ```typescript export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: 'mongodb', }), plugins: [nextCookies(), openAPI()], emailAndPassword: { enabled: true, requireEmailVerification: true, }, emailVerification: { sendOnSignUp: true, autoSignInAfterVerification: true, sendVerificationEmail: async ({ user, token }) => { const verificationUrl = `${process.env.BETTER_AUTH_URL}/api/auth/verify-email?token=${token}&callbackURL=${process.env.EMAIL_VERIFICATION_CALLBACK_URL}`; // Send the verification email here await mailer.sendMail({ from: process.env.EMAIL_FROM ?? 'admin@localhost', to: user.email, subject: 'Verify your email address', html: `<p>Click the following link to verify your email address:</p> <p><a href="${verificationUrl}">Verify Link</a></p>`, }); }, }, } satisfies BetterAuthOptions); export type Session = typeof auth.$Infer.Session; ``` ### Additional context ...
GiteaMirror added the lockedbug labels 2026-04-13 03:41:10 -05:00
Author
Owner

@daveycodez commented on GitHub (Dec 28, 2024):

+1 emailVerification.sendOnSignIn would be a good solution here

<!-- gh-comment-id:2564277932 --> @daveycodez commented on GitHub (Dec 28, 2024): +1 `emailVerification.sendOnSignIn` would be a good solution here
Author
Owner

@ngadceser commented on GitHub (Dec 28, 2024):

emailVerification.sendOnSignIn

I would love it if there was a property to do "sendOnSignIn: false".

<!-- gh-comment-id:2564320090 --> @ngadceser commented on GitHub (Dec 28, 2024): > `emailVerification.sendOnSignIn` I would love it if there was a property to do "sendOnSignIn: false".
Author
Owner

@Nicolab commented on GitHub (Dec 29, 2024):

Yes, it will be more clean. To keep the link with a related issue https://github.com/better-auth/better-auth/issues/788

<!-- gh-comment-id:2564780364 --> @Nicolab commented on GitHub (Dec 29, 2024): Yes, it will be more clean. To keep the link with a related issue https://github.com/better-auth/better-auth/issues/788
Author
Owner

@dosubot[bot] commented on GitHub (Jun 15, 2025):

Hi, @ngadceser. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • You requested help to modify the authentication system to display a message instead of resending a verification email on sign-in attempts.
  • User daveycodez suggested using a property like emailVerification.sendOnSignIn to control this behavior.
  • Nicolab linked a related issue for further context, and you expressed interest in disabling the email resend feature.
  • The suggestion received positive feedback and seems to meet your needs.

Next Steps

  • Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2974147631 --> @dosubot[bot] commented on GitHub (Jun 15, 2025): Hi, @ngadceser. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary** - You requested help to modify the authentication system to display a message instead of resending a verification email on sign-in attempts. - User daveycodez suggested using a property like `emailVerification.sendOnSignIn` to control this behavior. - Nicolab linked a related issue for further context, and you expressed interest in disabling the email resend feature. - The suggestion received positive feedback and seems to meet your needs. **Next Steps** - Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open. - Otherwise, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@Nicolab commented on GitHub (Jun 16, 2025):

Hi, @ngadceser. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • You requested help to modify the authentication system to display a message instead of resending a verification email on sign-in attempts.
  • User daveycodez suggested using a property like emailVerification.sendOnSignIn to control this behavior.
  • Nicolab linked a related issue for further context, and you expressed interest in disabling the email resend feature.
  • The suggestion received positive feedback and seems to meet your needs.

Next Steps

  • Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

Yes this issue is still relevant to the latest version.

<!-- gh-comment-id:2975317255 --> @Nicolab commented on GitHub (Jun 16, 2025): > Hi, [@ngadceser](https://github.com/ngadceser). I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. > > **Issue Summary** > > * You requested help to modify the authentication system to display a message instead of resending a verification email on sign-in attempts. > * User daveycodez suggested using a property like `emailVerification.sendOnSignIn` to control this behavior. > * Nicolab linked a related issue for further context, and you expressed interest in disabling the email resend feature. > * The suggestion received positive feedback and seems to meet your needs. > > **Next Steps** > > * Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open. > * Otherwise, this issue will be automatically closed in 7 days. > > Thank you for your understanding and contribution! Yes this issue is still relevant to the latest version.
Author
Owner

@frectonz commented on GitHub (Aug 11, 2025):

sendOnSignIn is already available

<!-- gh-comment-id:3176686415 --> @frectonz commented on GitHub (Aug 11, 2025): `sendOnSignIn` is already available
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8567