Send Verification Email for any user #1362

Closed
opened 2026-03-13 08:34:56 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @zispidd on GitHub (Jun 15, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Current vs. Expected behavior

If I understand correctly, a user on the client can call
await auth.sendVerificationEmail({
email: email
})
and thereby send an email to any user as if they had requested it. For example, I have a user user1@example.com with an unconfirmed email address in my database. I log in as user2@example.com and call the function await auth.sendVerificationEmail({
email: ‘user1@example.com'
})
And user1@example.com will receive an email with a confirmation link, although this should not happen because user2 has no relation to user1.

What version of Better Auth are you using?

1.2.9

Provide environment information

- Bun, MacOS

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

Client

Auth config (if applicable)


Additional context

No response

Originally created by @zispidd on GitHub (Jun 15, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - ### Current vs. Expected behavior If I understand correctly, a user on the client can call await auth.sendVerificationEmail({ email: email }) and thereby send an email to any user as if they had requested it. For example, I have a user user1@example.com with an unconfirmed email address in my database. I log in as user2@example.com and call the function await auth.sendVerificationEmail({ email: ‘user1@example.com' }) And user1@example.com will receive an email with a confirmation link, although this should not happen because user2 has no relation to user1. ### What version of Better Auth are you using? 1.2.9 ### Provide environment information ```bash - Bun, MacOS ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 08:34:56 -05:00
Author
Owner

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

Is this a question or you are asking for clarification. For security reason, you can call sendVerificationEmail on the server auth.api. sendVerificationEmail

@jpainam commented on GitHub (Jun 16, 2025): Is this a question or you are asking for clarification. For security reason, you can call `sendVerificationEmail` on the server `auth.api. sendVerificationEmail`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1362