[PR #7201] feat(haveIBeenPawned): allow async fn for custom compromised msg #7140

Open
opened 2026-03-13 13:25:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7201
Author: @ping-maxwell
Created: 1/8/2026
Status: 🔄 Open

Base: canaryHead: feat/haveIBeenPawned/custom-msg-async-fn


📝 Commits (8)

  • b7562aa feat(haveIBeenPawned): allow async fn for custom compromised msg
  • 65d5cb5 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • f4618b9 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • 0deb6b0 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • b395172 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • e332e48 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • abf2c46 Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn
  • 40957dc Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn

📊 Changes

2 files changed (+25 additions, -3 deletions)

View changed files

📝 docs/content/docs/plugins/have-i-been-pwned.mdx (+14 -0)
📝 packages/better-auth/src/plugins/haveibeenpwned/index.ts (+11 -3)

📄 Description

closes https://github.com/better-auth/better-auth/issues/6247


Summary by cubic

Allow customPasswordCompromisedMessage in the Have I Been Pwned plugin to be a function (sync or async) so apps can load locale-specific messages. Updated docs with an async example.

  • New Features
    • Accepts string or () => string | Promise, evaluates it, and uses the result in the error message.

Written for commit 40957dc96a. 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/7201 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/8/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `feat/haveIBeenPawned/custom-msg-async-fn` --- ### 📝 Commits (8) - [`b7562aa`](https://github.com/better-auth/better-auth/commit/b7562aaf051b0a458ed3fbee7e4f98399bf45b92) feat(haveIBeenPawned): allow async fn for custom compromised msg - [`65d5cb5`](https://github.com/better-auth/better-auth/commit/65d5cb57a819602237db3cc60a275449750dcd0f) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`f4618b9`](https://github.com/better-auth/better-auth/commit/f4618b9436e5e403a0c3d30e1f1cfde88b8ae9fc) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`0deb6b0`](https://github.com/better-auth/better-auth/commit/0deb6b0c463d447b43ef986a10a837a82fff2bc1) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`b395172`](https://github.com/better-auth/better-auth/commit/b39517229084420abf942233602f3cc77a3e5b1f) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`e332e48`](https://github.com/better-auth/better-auth/commit/e332e48ef0b5e8272cc372417e965eb537546ef5) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`abf2c46`](https://github.com/better-auth/better-auth/commit/abf2c46dbb718be6548fd38a36f241fd56fca237) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn - [`40957dc`](https://github.com/better-auth/better-auth/commit/40957dc96a7298532b8c82755a02a18a7323eba8) Merge branch 'canary' into feat/haveIBeenPawned/custom-msg-async-fn ### 📊 Changes **2 files changed** (+25 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/have-i-been-pwned.mdx` (+14 -0) 📝 `packages/better-auth/src/plugins/haveibeenpwned/index.ts` (+11 -3) </details> ### 📄 Description closes https://github.com/better-auth/better-auth/issues/6247 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Allow customPasswordCompromisedMessage in the Have I Been Pwned plugin to be a function (sync or async) so apps can load locale-specific messages. Updated docs with an async example. - **New Features** - Accepts string or () => string | Promise<string>, evaluates it, and uses the result in the error message. <sup>Written for commit 40957dc96a7298532b8c82755a02a18a7323eba8. 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:25:31 -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#7140