Option to normalize email addresses by ignoring “+” aliases #1930

Closed
opened 2026-03-13 09:13:09 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @bayromest on GitHub (Sep 15, 2025).

Is this suited for github?

  • Yes, this is suited for github

I’m often frustrated that many email providers (e.g. Gmail, Outlook, ProtonMail, Fastmail) allow one person to create multiple accounts using the same base email with a “+” alias. For example, user@gmail.com and user+test@gmail.com are treated as different accounts in Better Auth, which can lead to duplicate users, abuse, and unnecessary complexity in account management.

Describe the solution you'd like

I’d like an optional configuration flag (e.g. normalizeSubaddressing: true) that, when enabled, strips the “+...” portion of addresses before saving or comparing them. This way user@gmail.com, user+test@gmail.com, and user+anything@gmail.com are recognized as the same account.

Describe alternatives you've considered

Opting-in this option in the auth.ts file

Additional context

Subaddressing (the +alias feature) is part of the official email standard (RFC 5233), Other authentication providers (Firebase, Auth0, etc.) already offer similar normalization options.

This would help prevent abuse during signups while remaining fully backward compatible by default.

Originally created by @bayromest on GitHub (Sep 15, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I’m often frustrated that many email providers (e.g. Gmail, Outlook, ProtonMail, Fastmail) allow one person to create multiple accounts using the same base email with a “+” alias. For example, user@gmail.com and user+test@gmail.com are treated as different accounts in Better Auth, which can lead to duplicate users, abuse, and unnecessary complexity in account management. ### Describe the solution you'd like I’d like an optional configuration flag (e.g. normalizeSubaddressing: true) that, when enabled, strips the “+...” portion of addresses before saving or comparing them. This way user@gmail.com, user+test@gmail.com, and user+anything@gmail.com are recognized as the same account. ### Describe alternatives you've considered Opting-in this option in the auth.ts file ### Additional context Subaddressing (the +alias feature) is part of the official email standard (RFC 5233), Other authentication providers (Firebase, Auth0, etc.) already offer similar normalization options. This would help prevent abuse during signups while remaining fully backward compatible by default.
GiteaMirror added the enhancementgood first issue labels 2026-03-13 09:13:09 -05:00
Author
Owner

@bayromest commented on GitHub (Sep 15, 2025):

just realized that other email providers also have this feature like outlook, yahoo, protonmail, etc etc
so this is not only gmail special

@bayromest commented on GitHub (Sep 15, 2025): just realized that other email providers also have this feature like outlook, yahoo, protonmail, etc etc so this is not only gmail special
Author
Owner

@himself65 commented on GitHub (Sep 15, 2025):

Good idea. I think we can have an option to customize the normalize function for email. It's not hard to implement that. Feel free to PR.

@himself65 commented on GitHub (Sep 15, 2025): Good idea. I think we can have an option to customize the normalize function for email. It's not hard to implement that. Feel free to PR.
Author
Owner

@bayromest commented on GitHub (Sep 15, 2025):

i'll go ahead and fork the repo to try implementing this as a configurable normalizeEmail option. im not 100% confident in my ts for a codebase like betterath, so i'll probably open it first as a draft pr and refine it with your feedback

@bayromest commented on GitHub (Sep 15, 2025): i'll go ahead and fork the repo to try implementing this as a configurable normalizeEmail option. im not 100% confident in my ts for a codebase like betterath, so i'll probably open it first as a draft pr and refine it with your feedback
Author
Owner

@himself65 commented on GitHub (Sep 15, 2025):

amazing, thanks

@himself65 commented on GitHub (Sep 15, 2025): amazing, thanks
Author
Owner

@obazoud commented on GitHub (Sep 28, 2025):

There’s a community plugin that already handles email (and phone) normalization: Better Auth Harmony

@obazoud commented on GitHub (Sep 28, 2025): There’s a [community plugin](https://www.better-auth.com/docs/plugins/community-plugins) that already handles [email (and phone) normalization](https://github.com/GeKorm/better-auth-harmony): Better Auth Harmony
Author
Owner

@dosubot[bot] commented on GitHub (Dec 28, 2025):

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

Issue Summary:

  • You requested an optional feature to normalize email addresses by ignoring the “+” alias portion to reduce duplicate accounts and abuse.
  • The maintainer expressed support for a customizable normalizeEmail option and invited you to submit a draft PR.
  • You planned to fork and implement this feature with feedback.
  • Another user pointed out an existing community plugin, Better Auth Harmony, that already provides email normalization.
  • The issue remains unresolved with no recent updates on progress or PR submission.

Next Steps:

  • Please let me know if this feature is still relevant to the latest version of better-auth and if you plan to continue working on it by commenting here.
  • Otherwise, I will automatically close this issue in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 28, 2025): Hi, @bayromest. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested an optional feature to normalize email addresses by ignoring the “+” alias portion to reduce duplicate accounts and abuse. - The maintainer expressed support for a customizable `normalizeEmail` option and invited you to submit a draft PR. - You planned to fork and implement this feature with feedback. - Another user pointed out an existing community plugin, Better Auth Harmony, that already provides email normalization. - The issue remains unresolved with no recent updates on progress or PR submission. **Next Steps:** - Please let me know if this feature is still relevant to the latest version of better-auth and if you plan to continue working on it by commenting here. - Otherwise, I will automatically close this issue in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1930