[PR #6144] [CLOSED] refactor(haveibeenpwned): add try catch and timeout #6479

Closed
opened 2026-03-13 13:00:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6144
Author: @Bekacru
Created: 11/20/2025
Status: Closed

Base: canaryHead: fix/haveibeenpwned


📝 Commits (1)

  • 2c2b990 reafctor(haveibeenpwned): add try catch and timeout

📊 Changes

1 file changed (+12 additions, -7 deletions)

View changed files

📝 packages/better-auth/src/plugins/haveibeenpwned/index.ts (+12 -7)

📄 Description

Summary by cubic

Add a 5s timeout to the Have I Been Pwned API call and wrap the password compromise check in try/catch so hashing always proceeds if the request fails. This prevents auth flows from hanging or breaking when the HIBP service is slow or unreachable, while still checking on allowed paths.

Written for commit 2c2b990aa2. Summary will update automatically 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/6144 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/20/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/haveibeenpwned` --- ### 📝 Commits (1) - [`2c2b990`](https://github.com/better-auth/better-auth/commit/2c2b990aa20154b121f413009f4359199c4e825d) reafctor(haveibeenpwned): add try catch and timeout ### 📊 Changes **1 file changed** (+12 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/haveibeenpwned/index.ts` (+12 -7) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Add a 5s timeout to the Have I Been Pwned API call and wrap the password compromise check in try/catch so hashing always proceeds if the request fails. This prevents auth flows from hanging or breaking when the HIBP service is slow or unreachable, while still checking on allowed paths. <sup>Written for commit 2c2b990aa20154b121f413009f4359199c4e825d. Summary will update automatically 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:00:41 -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#6479