Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`consumeOne` method not implemented — password reset broken with `better-auth >=1.7.0`

Đang mở
#2,820 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
60/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, typescript
Lĩnh vực
authentication

Hướng nghiên cứu

Start in the @zenstackhq/better-auth adapter package and read the existing adapter methods (findOne, delete/consume on the verification table) to see the conventions for token records. Then check the better-auth 1.7 adapter contract for consumeOne's exact signature and return shape before implementing an atomic find-and-delete. Done means a password reset completes on better-auth 1.7.x with an unmodified caller, and the peerDependencies range in the adapter package reflects the supported version. A test exercising sendResetPassword end to end is the way to confirm it.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

The zenstackAdapter does not implement the consumeOne method, which became required in [email protected]. This causes a BetterAuthError when users attempt to reset their password.

Error

BetterAuthError: Adapter "zenstack" must implement consumeOne for atomic single-use credential consumption.
    at factory.mjs:699:68

Steps to Reproduce

  1. Set up a project with better-auth@^1.6.26 (resolves to 1.7.x) and @zenstackhq/[email protected]
  2. Configure email/password with sendResetPassword
  3. Request a password reset email
  4. Click the reset link and submit the new password
  5. The error above is thrown

Expected Behavior

Password reset completes successfully. The consumeOne method should atomically find and delete the single-use token from the verification table.

Environment

  • @zenstackhq/better-auth: 3.9.2
  • better-auth: 1.7.1
  • Provider: PostgreSQL

Notes

  • [email protected] introduced consumeOne as a required adapter method for atomic single-use credential consumption (used for password reset tokens and potentially email verification tokens).
  • The peerDependencies allow better-auth: "^1.3.0", but the adapter does not work with 1.7.x.
  • As a workaround, I've pinned better-auth to ~1.6.26 to avoid the breaking change.
  • This likely affects all versions of @zenstackhq/better-auth.

Workaround

Pin better-auth to ~1.6.26 in your package.json:

"better-auth": "~1.6.26"
Ngôn ngữ chính
TypeScript
Star
2.9k
Fork
157
Merge trung bình
2 ngày 46 phút
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của zenstackhq/zenstack

Tất cả issue của zenstackhq/zenstack

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.