Device-flow refresh token rejected immediately: 400 "refresh_token is invalid" on first refresh
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 32/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- authentication
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 842
- Forks
- 136
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 88
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stripe/link-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
bunx hangs after link-cli commands by implicitly starting a development serverPosiblemente ocupada @awesamarth la tomó hace 33 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
stripe/link-cli#294 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de stripe/link-cli
Issues similares
-
useFragment does not require `variables` when the fragment's variables type has required fieldsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apollographql/apollo-client#13493 ·
Los mantenedores suelen responder en 1 día
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsPosiblemente ocupada @roboomp la tomó hoy. Abiertobug prio:p2 providers triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
can1357/oh-my-pi#15798 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
code-yeongyu/oh-my-openagent#10172 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
PDFCraftTool/pdfcraft#189 ·
-
Add the Yahoo chart API duplicate last-day row (yfinance#573) to incidents.md (about 1 hour)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodata docs good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
pacocartones/market-data-sanity-checker#160 ·
Los mantenedores suelen responder en 1 día