Two-factor setup doesn't compile against the new better-auth types
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/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ệ
- bun, typescript
- Lĩnh vực
- authentication, testing
Hướng nghiên cứu
Bắt đầu trong apps/web/src/routes/profile.tsx tại start() và thu hẹp kết quả của twoFactor.enable dựa trên method trước khi đọc các trường TOTP; kiểm tra dòng lỗi hiện có cho trường hợp không phải TOTP. Sau đó, cập nhật các assertion trong packages/auth/src/two-factor.test.ts và packages/auth/src/sign-in-events.test.ts để kiểm tra method dự kiến. Trên branch #12, chạy bun run typecheck và bun test packages/auth; cả hai đều sẽ chạy thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Dependabot's minor-and-patch group (#12) moves better-auth forward, and with it the return type of twoFactor.enable. It used to promise a TOTP URI and backup codes every time. Now it says what it actually does: you get { method: "otp" } or { method: "totp"; totpURI; backupCodes }, depending on how two-factor was turned on.
Our code reads totpURI and backupCodes straight off the result, so the typecheck fails on #12 at d3f9dcc0 and the whole group is stuck behind it.
Where
apps/web/src/routes/profile.tsx:527and:530, instart()packages/auth/src/two-factor.test.ts:44,:46,:47packages/auth/src/sign-in-events.test.ts:176,:187,:346
What to change
Narrow on method before reading the TOTP fields. In profile.tsx, an answer that isn't "totp" should show the existing error line rather than handing new URL("") an empty string, which throws. The tests can assert method === "totp" first; that's a better test anyway, since it says which kind of setup they expect.
Please don't add a cast. The new type is telling the truth.
Test
Check out the #12 branch (dependabot/bun/minor-and-patch-…), make the change on top, then:
bun run typecheck
bun test packages/auth
Both should pass, and #12 can merge once this lands.
- Ngôn ngữ chính
- TypeScript
- Star
- 13
- Fork
- 3
- Merge trung bình
- 38 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Sentrello/Sentrello
-
dependencies help wanted javascript
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies help wanted javascript
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Sentrello/Sentrello
Issue tương tự
-
agent/guide documentation help wanted stage/010-actionable
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
kubestellar/console-marketplace#1101 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Java Edition Tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
JSPrismarine/JSPrismarine#4178 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
totec448-spec/chat-on-steroids#2394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
StellarHyperion/stellarhyperion-backend#499 ·
Maintainer thường phản hồi trong vòng 1 ngày