Device-flow refresh token rejected immediately: 400 "refresh_token is invalid" on first refresh
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- authentication
Hướng nghiên cứu
Start from the refresh path the report names: AuthResource.refreshToken and createAccessTokenProvider in @stripe/link-cli. Reproduce by running link-cli auth login, moving expires_at into the past in config.json, then link-cli payment-methods list --verbose to capture the POST /device/token request and body. Because the same code path works in 0.25.1, first establish whether the 400 comes from the server for a token the CLI stored correctly, and read the apiFetch retry path in #294. Done means a device-flow refresh token survives the one-hour access-token expiry.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A refresh token issued by the device flow is rejected immediately. POST https://login.link.com/device/token with grant_type=refresh_token returns 400 {"error":{"message":"refresh_token is invalid"}}, even when the refresh token is brand new and has never been used.
The result: every link-cli session dies one hour after login, when the access token expires. The user must approve a new device login before each purchase.
Reproduction (2026-10-04, ~16:17 UTC)
link-cli auth logout, thenlink-cli auth login --client-name "Hermes on Oren".- Approve the device login in the Link app.
auth statusreturnsauthenticated: true, scopeuserinfo:read payment_methods.agentic,expires_in3600. link-cli user-info retrieveandlink-cli payment-methods listsucceed with the new access token.- About 2 minutes after login, force a refresh (set
expires_atin the past inconfig.json, then runlink-cli payment-methods list). Result:Token refresh failed (400): refresh_token is invalid.--verboseshows the request isPOST /device/tokenwithgrant_type=refresh_token, the stored refresh token (liwlrefresh_...), andclient_id=lwlpk_U7Qy7ThG69STZk. - Restore the original
expires_at: the access token still works. Only the refresh token is rejected.
The refresh token was used exactly once, from one process on one machine. No other machine or process holds it.
History
- In August 2026, one login kept working for weeks, so refresh worked then (CLI ~0.10-0.15).
- Since about 2026-09-25, every refresh fails with this error, on every new login.
Environment
@stripe/link-cli0.19.0. The refresh code path (AuthResource.refreshToken,createAccessTokenProvider) is identical in 0.25.1.- Node 26, macOS 26.
Related
auth statusreportsauthenticated: truewhile the refresh token is already unusable, so agents only discover the dead session at payment time.- #294: the 401-retry path in
apiFetchcan re-send a POST. A refresh failure makes that path more likely to be hit.
- Ngôn ngữ chính
- TypeScript
- Star
- 842
- Fork
- 136
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 82
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 stripe/link-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
420984Đang mở
Maintainer thường phản hồi trong vòng 1 ngày
-
عمرو عزوزĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
Maintainer thường phản hồi trong vòng 1 ngày
-
zeynalovsuleyman080-boopĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
stripe/link-cli#392 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stripe/link-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
high priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 bình luận ·
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated messageCó thể đã có người làm @CapThunder19 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
joinmarket-webui/jam#1538 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t0ggles
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nolimits4web/swiper#8240 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày