bug: Better Auth account-info rejects useAccountCookie over HTTP (upstream better-auth#10911)

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

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

@mustafaskyer đang làm issue này rồi.

Từ ngày 1/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug
Area

Providers and integrations

RELKIT version

@relkit/better-auth 0.8.3 (workspace main), with better-auth 1.7.1

Tracking issue for an upstream Better Auth bug that RELKIT apps hit through the API reference. The defect is in Better Auth, not RELKIT; this issue stays open until the upstream fix ships and we have verified it here.

Upstream
  • Issue: better-auth/better-auth#10911 — accountInfo (GET) rejects useAccountCookie: true
  • Fix: better-auth/better-auth#10918 — open, awaiting review

account-info shares an account-selection schema with POST endpoints and declares useAccountCookie: z.literal(true). A GET query value always arrives as text, so ?useAccountCookie=true sends "true" and can never match. get-session does not have this problem because its booleans use z.coerce.boolean().

Minimal reproduction
  1. In a RELKIT app with Better Auth, sign in with POST /api/auth/sign-in/email.
  2. Open the API reference (relkit inspector → Scalar, or the app's own reference) and send GET /api/auth/account-info?useAccountCookie=true.

The same request against a plain betterAuth() instance with no RELKIT code returns the same error, which confirms the defect is upstream.

Expected behavior

?useAccountCookie=true passes validation and selects the account from its signed OAuth cookie, as the Better Auth docs describe.

Actual behavior and logs
GET /api/auth/account-info?useAccountCookie=true
400 {"code":"VALIDATION_ERROR","message":"[query] Must match one of 2 shapes: (accountId: required, expected string, useAccountCookie: not accepted in this shape) or (useAccountCookie: expected true, received the text \"true\")"}

Plain Better Auth returns [query] Invalid input; the field-level wording above comes from RELKIT's validation detail in packages/better-auth/src/validation-detail.ts.

Environment

Bun 1.3.10, macOS (Darwin 24.6.0, arm64)

To close this issue
  • Better Auth releases a version that includes the fix (better-auth/better-auth#10918 or an alternative).
  • Bump better-auth in the workspace catalog and the CLI build catalog.
  • Re-run the reproduction: GET /api/auth/account-info?useAccountCookie=true passes validation (with no OAuth account cookie it should then fail with an account error, not VALIDATION_ERROR).
  • Update packages/better-auth/tests/validation-detail.test.ts: the test "shows the received value when a query string cannot match a non-string field" uses this upstream bug as its fixture, so it needs another non-string query field.
  • Confirm the API reference still documents the account-info alternatives (packages/better-auth/tests/openapi-query.test.ts).
Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Merge trung bình
2 giờ 45 phút
Pull request đã merge (30 ngày)
64

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

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 rel-kit/relkit

Tất cả issue của rel-kit/relkit

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.