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

Closed
opened 2026-04-15 22:42:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8728
Author: @aarmful
Created: 3/21/2026
Status: Merged
Merged: 3/22/2026
Merged by: @bytaesu

Base: canaryHead: feat/haveIBeenPwned-enabled-option


📝 Commits (6)

  • 0996f42 feat(haveibeenpwned): add enable option
  • 75318e7 feat(haveibeenpwned): add enable option to docs
  • b798cb3 docs: update options content
  • a22385c chore: update auth-terms
  • d7f49d3 chore: rename enable to enabled
  • a9b15b3 chore: add JSDoc

📊 Changes

4 files changed (+70 additions, -6 deletions)

View changed files

📝 .cspell/auth-terms.txt (+1 -0)
📝 docs/content/docs/plugins/have-i-been-pwned.mdx (+33 -6)
📝 packages/better-auth/src/plugins/haveibeenpwned/haveibeenpwned.test.ts (+25 -0)
📝 packages/better-auth/src/plugins/haveibeenpwned/index.ts (+11 -0)

📄 Description

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.


🔄 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/8728 **Author:** [@aarmful](https://github.com/aarmful) **Created:** 3/21/2026 **Status:** ✅ Merged **Merged:** 3/22/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `feat/haveIBeenPwned-enabled-option` --- ### 📝 Commits (6) - [`0996f42`](https://github.com/better-auth/better-auth/commit/0996f42c00570a7178afb7276e1fe1c70ab7c09a) feat(haveibeenpwned): add enable option - [`75318e7`](https://github.com/better-auth/better-auth/commit/75318e7ed06f648e89d85fe466eab84475288cc3) feat(haveibeenpwned): add enable option to docs - [`b798cb3`](https://github.com/better-auth/better-auth/commit/b798cb3151d63a88f3821463f555d458b20fcf29) docs: update options content - [`a22385c`](https://github.com/better-auth/better-auth/commit/a22385cdbe32cbde077446ece2ca9a882144382f) chore: update auth-terms - [`d7f49d3`](https://github.com/better-auth/better-auth/commit/d7f49d397ba9cc9be400b2cb714cb6692ce51787) chore: rename enable to enabled - [`a9b15b3`](https://github.com/better-auth/better-auth/commit/a9b15b365677f946426b6bc9e9877b5e2095d9fc) chore: add JSDoc ### 📊 Changes **4 files changed** (+70 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/auth-terms.txt` (+1 -0) 📝 `docs/content/docs/plugins/have-i-been-pwned.mdx` (+33 -6) 📝 `packages/better-auth/src/plugins/haveibeenpwned/haveibeenpwned.test.ts` (+25 -0) 📝 `packages/better-auth/src/plugins/haveibeenpwned/index.ts` (+11 -0) </details> ### 📄 Description 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. --> --- <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-04-15 22:42:57 -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#25075