[PR #8728] feat(haveibeenpwned): add enable option #16421

Closed
opened 2026-04-13 10:31:02 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/8728

State: closed
Merged: Yes


closes #8726

adds an enable option to the haveIBeenPwned plugin to allow opting out of password compromise checks without removing the plugin entirely. defaults to true.

this could be an anti-pattern. the cleaner approach is just not including the plugin at all:

plugins: [someCondition && haveIBeenPwned()]

happy to close this if you think it's unnecessary.


Summary by cubic

Add an enabled option to the haveIBeenPwned plugin so teams can temporarily disable password compromise checks without removing the plugin. Defaults to true.

  • New Features
    • enabled?: boolean (default true) — when false, HIBP checks are skipped and the original password hash is used; tests cover disabled mode.
    • Docs/JSDoc: updated Options with a prod-only example and custom message usage, refreshed error message, added HIBP to spellcheck, and added JSDoc for options.

Written for commit a9b15b3656. Summary will update on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8728 **State:** closed **Merged:** Yes --- closes #8726 adds an `enable` option to the `haveIBeenPwned` plugin to allow opting out of password compromise checks without removing the plugin entirely. defaults to `true`. this could be an anti-pattern. the cleaner approach is just not including the plugin at all: ```ts plugins: [someCondition && haveIBeenPwned()] ``` happy to close this if you think it's unnecessary. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add an `enabled` option to the `haveIBeenPwned` plugin so teams can temporarily disable password compromise checks without removing the plugin. Defaults to true. - **New Features** - `enabled?: boolean` (default `true`) — when `false`, HIBP checks are skipped and the original password hash is used; tests cover disabled mode. - Docs/JSDoc: updated Options with a prod-only example and custom message usage, refreshed error message, added `HIBP` to spellcheck, and added JSDoc for options. <sup>Written for commit a9b15b365677f946426b6bc9e9877b5e2095d9fc. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 10:31:02 -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#16421