[PR #7598] Email generation helper #7432

Open
opened 2026-03-13 13:36:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7598
Author: @bytaesu
Created: 1/24/2026
Status: 🔄 Open

Base: canaryHead: cursor/email-generation-helper-0ff6


📝 Commits (3)

  • e397fce feat(test-utils): add generateEmail() helper for test email generation
  • d71de4a refactor(test-utils): make ID generation customizable in generateEmail
  • 4587a42 feat(utils): move generateEmail to user-accessible utils

📊 Changes

16 files changed (+93 additions, -37 deletions)

View changed files

📝 packages/better-auth/package.json (+5 -0)
📝 packages/better-auth/src/api/rate-limiter/rate-limiter.test.ts (+2 -2)
📝 packages/better-auth/src/api/routes/update-user.test.ts (+2 -2)
📝 packages/better-auth/src/plugins/email-otp/email-otp.test.ts (+5 -5)
📝 packages/better-auth/src/plugins/haveibeenpwned/haveibeenpwned.test.ts (+4 -4)
📝 packages/better-auth/src/plugins/mcp/mcp.test.ts (+2 -2)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+10 -10)
📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.test.ts (+5 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.test.ts (+6 -3)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.test.ts (+5 -2)
📝 packages/better-auth/src/plugins/organization/team.test.ts (+2 -2)
📝 packages/better-auth/src/test-utils/index.ts (+1 -0)
📝 packages/better-auth/src/test-utils/test-instance.ts (+2 -0)
packages/better-auth/src/utils/email.ts (+37 -0)
📝 packages/better-auth/src/utils/index.ts (+1 -0)
📝 packages/stripe/test/stripe.test.ts (+4 -3)

📄 Description

This pull request contains changes generated by a Cursor Cloud Agent

Open in Cursor Open in Web


Summary by cubic

Added a generateEmail() helper to standardize unique email generation across tests and exported it via better-auth/utils for public use.

  • Refactors
    • Implemented utils/email.ts with generateEmail(options) supporting prefix, domain, and custom id; defaults to generateId().
    • Added './utils' export in package.json and re-exported from test-utils and test-instance for compatibility.
    • Updated tests across auth, plugins, and Stripe to use the helper.

Written for commit 4587a42769. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7598 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/24/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `cursor/email-generation-helper-0ff6` --- ### 📝 Commits (3) - [`e397fce`](https://github.com/better-auth/better-auth/commit/e397fce36095e890663033c1b866079713cd3dd1) feat(test-utils): add generateEmail() helper for test email generation - [`d71de4a`](https://github.com/better-auth/better-auth/commit/d71de4ab80b6c03659c881d46b3aebd9448c8bcc) refactor(test-utils): make ID generation customizable in generateEmail - [`4587a42`](https://github.com/better-auth/better-auth/commit/4587a427695468890e99b70cd583df5ea29937ba) feat(utils): move generateEmail to user-accessible utils ### 📊 Changes **16 files changed** (+93 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+5 -0) 📝 `packages/better-auth/src/api/rate-limiter/rate-limiter.test.ts` (+2 -2) 📝 `packages/better-auth/src/api/routes/update-user.test.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/email-otp/email-otp.test.ts` (+5 -5) 📝 `packages/better-auth/src/plugins/haveibeenpwned/haveibeenpwned.test.ts` (+4 -4) 📝 `packages/better-auth/src/plugins/mcp/mcp.test.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+10 -10) 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.test.ts` (+5 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.test.ts` (+6 -3) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.test.ts` (+5 -2) 📝 `packages/better-auth/src/plugins/organization/team.test.ts` (+2 -2) 📝 `packages/better-auth/src/test-utils/index.ts` (+1 -0) 📝 `packages/better-auth/src/test-utils/test-instance.ts` (+2 -0) ➕ `packages/better-auth/src/utils/email.ts` (+37 -0) 📝 `packages/better-auth/src/utils/index.ts` (+1 -0) 📝 `packages/stripe/test/stripe.test.ts` (+4 -3) </details> ### 📄 Description This pull request contains changes generated by a Cursor Cloud Agent <a href="https://cursor.com/background-agent?bcId=bc-ba2f1470-ddf2-4116-83eb-522650311e8c"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-ba2f1470-ddf2-4116-83eb-522650311e8c"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added a generateEmail() helper to standardize unique email generation across tests and exported it via better-auth/utils for public use. - **Refactors** - Implemented utils/email.ts with generateEmail(options) supporting prefix, domain, and custom id; defaults to generateId(). - Added './utils' export in package.json and re-exported from test-utils and test-instance for compatibility. - Updated tests across auth, plugins, and Stripe to use the helper. <sup>Written for commit 4587a427695468890e99b70cd583df5ea29937ba. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:36:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7432