[GH-ISSUE #8726] Add enable key value in haveIBeenPwned plugin #19802

Closed
opened 2026-04-15 19:09:02 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @saiful7778 on GitHub (Mar 21, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8726

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

I have been using the haveIBeenPwned plugin in my code. I want to disable this plugin on development or testing and enable it in production.

Currently, I use it like this:

const defaultPlugins: Array<BetterAuthPlugin> = [];

if (env.NODE_ENV === "production") {
  defaultPlugins.push(
    haveIBeenPwned({
      customPasswordCompromisedMessage:
        "This password is compromised, choose a stronger one",
    })
  );
}

betterAuth({
  // rest of the configs
  plugins: [
    ...defaultPlugins,
  ],
  // rest of the configs
});

Describe alternatives you've considered

Add enable key value

Additional context

No response

Originally created by @saiful7778 on GitHub (Mar 21, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8726 ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like I have been using the `haveIBeenPwned` plugin in my code. I want to disable this plugin on development or testing and enable it in production. Currently, I use it like this: ```typescript const defaultPlugins: Array<BetterAuthPlugin> = []; if (env.NODE_ENV === "production") { defaultPlugins.push( haveIBeenPwned({ customPasswordCompromisedMessage: "This password is compromised, choose a stronger one", }) ); } betterAuth({ // rest of the configs plugins: [ ...defaultPlugins, ], // rest of the configs }); ``` ### Describe alternatives you've considered Add `enable` key value ### Additional context _No response_
GiteaMirror added the lockedenhancement labels 2026-04-15 19:09:02 -05:00
Author
Owner

@aarmful commented on GitHub (Mar 21, 2026):

i can do this if you're not working on a PR

<!-- gh-comment-id:4104368911 --> @aarmful commented on GitHub (Mar 21, 2026): i can do this if you're not working on a PR
Author
Owner

@github-actions[bot] commented on GitHub (Mar 31, 2026):

This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.

<!-- gh-comment-id:4165911172 --> @github-actions[bot] commented on GitHub (Mar 31, 2026): This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19802