[GH-ISSUE #216] feat: magic link should verify user email #25498

Closed
opened 2026-04-17 15:45:15 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @eNiiju on GitHub (Oct 17, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/216

I think calling the authClient.magicLink.verify() function should set the emailVerified field in the user table to true.

The action of a user clicking on this link from their email inbox is equivalent to clicking on a verification link, as the user clearly has access to the email address he provided.

Maybe this can be an optional setting, something like this :

export const auth = betterAuth({
  plugins: [
    magicLink({
      verifyEmail: true
    })
  ]
});

This would save the users' time of clicking two links that could be done at once, and of course send fewer emails.

Originally created by @eNiiju on GitHub (Oct 17, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/216 I think calling the `authClient.magicLink.verify()` function should set the `emailVerified` field in the user table to `true`. The action of a user clicking on this link from their email inbox is equivalent to clicking on a verification link, as the user clearly has access to the email address he provided. Maybe this can be an optional setting, something like this : ```ts export const auth = betterAuth({ plugins: [ magicLink({ verifyEmail: true }) ] }); ``` This would save the users' time of clicking two links that could be done at once, and of course send fewer emails.
GiteaMirror added the locked label 2026-04-17 15:45:15 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 17, 2024):

we don't need the option. It should verify it by default.

<!-- gh-comment-id:2420556806 --> @Bekacru commented on GitHub (Oct 17, 2024): we don't need the option. It should verify it by default.
Author
Owner

@eNiiju commented on GitHub (Oct 17, 2024):

Yes the option is a bit overkill, I don't think a lot of people would want to disable this. Thanks for adding it so fast !

<!-- gh-comment-id:2420561939 --> @eNiiju commented on GitHub (Oct 17, 2024): Yes the option is a bit overkill, I don't think a lot of people would want to disable this. Thanks for adding it so fast !
Author
Owner

@yigsvnsla commented on GitHub (Feb 8, 2025):

hi @Bekacru @eNiiju

I think this function is still necessary and usable. I'd like to open a discussion about the importance of this function. for instance. this helps if I want to invite a potential user without having them directly stored on my database or using it as email verification.

export const auth = betterAuth({
  plugins: [
    magicLink({
      verifyEmail: true
    })
  ]
});

Functionally the only way I can replicate this is by modifying the database hook. Istead I can simply use the function I'm I mentioned is necessary

<!-- gh-comment-id:2644487509 --> @yigsvnsla commented on GitHub (Feb 8, 2025): hi @Bekacru @eNiiju I think this function is still necessary and usable. I'd like to open a discussion about the importance of this function. for instance. this helps if I want to invite a potential user without having them directly stored on my database or using it as email verification. ```ts export const auth = betterAuth({ plugins: [ magicLink({ verifyEmail: true }) ] }); ``` Functionally the only way I can replicate this is by modifying the database hook. Istead I can simply use the function I'm I mentioned is necessary
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25498