A faulty refresh path can discard tokens across hundreds of API connections, as seen in Nango's May 2025 incident.
*In May 2025 a faulty merge erased refreshed credentials for hundreds of API connections. The fallout revealed how token‑rotation practices can turn ordinary bugs into irreversible outages.*
Nango’s open‑source integration layer suffered a critical outage in May 2025 when a merged pull request broke the token‑refresh workflow. Within two hours the team rolled back the change, but not before scheduled jobs erased refreshed credentials for hundreds of third‑party connections. The incident forced dozens of customers to send their users back through consent screens, exposing a hidden fragility in modern OAuth implementations. As APIs proliferate—Nango now supports over 1,000 versus 400 a year earlier—the cost of a single bug has multiplied. The episode offers a stark reminder that token‑rotation mechanisms, while designed for security, can amplify operational risk.
In May 2025 Nango merged a pull request that contained an if‑condition which never fired. The condition prevented refreshed access and refresh tokens from being saved to the database. The bug was spotted and reverted in just under two hours. During that window scheduled jobs refreshed and discarded tokens for hundreds of connections. Most APIs recovered because the old refresh token still worked, allowing the next scheduled refresh to repair the link. However, providers that rotate refresh tokens immediately invalidated the old token, forcing users to repeat the consent flow.
Token rotation is a security win, but it also means a single bug can permanently break a connection. Providers such as Airtable, Atlassian, Salesforce and Slack revoke the previous refresh token the moment a new one is issued. Airtable even revokes the entire user authorization if a stale token is used or if the same refresh request is sent twice after a short grace period. Xero allows a 30‑minute retry window, but many others do not. Nango learned that refreshing early can also be wrong; Exact Online rejects refresh attempts made more than 30 seconds before expiry. The result: a bug that discards a token can force every affected user to re‑authorize.
The OAuth 2.0 spec makes the expires_in field optional, leaving many APIs silent about access‑token lifespans. Zendesk only includes expires_in when explicitly requested, yet the token still expires. Salesforce omits expiry entirely, requiring a separate introspection call that began returning unsupported_token_type intermittently in June 2024. NetSuite’s refresh tokens die after seven days, demanding full re‑consent. Google’s refresh tokens live indefinitely unless the app is in Testing status, unused for six months, or the user exceeds 100 live tokens. Nango now forces stale credentials onto a cron schedule to keep tokens active before inactivity kills them.
Nango now treats refresh tokens like cash, persisting the new token before any other operation can fail. The persistence path has dedicated regression tests, and any platform‑level anomaly pages the on‑call team immediately. Refreshes are serialized per connection behind a distributed lock to avoid duplicate requests that could trigger revocation. Provider‑specific expiration buffers were added after Exact Online rejected early refreshes. A cron job now exercises tokens regularly, preventing inactivity‑driven expiry. These safeguards aim to stop a repeat of the May 2025 outage.
A merged pull request contained an if‑condition that never fired, preventing refreshed credentials from being saved and causing scheduled jobs to discard tokens for hundreds of connections.
Providers like Airtable, Atlassian, Salesforce and Slack invalidate the old refresh token the moment a new one is issued, making the connection unrecoverable without user re‑authorization.
Nango persists new tokens before any other operation, adds regression tests for the persistence path, serializes refreshes with a distributed lock, and uses provider‑specific expiration buffers and cron‑driven token exercise.
Nango’s hard‑learned lessons underscore a broader industry truth: token‑rotation is not a plug‑and‑play security feature. Providers enforce it in divergent, often undocumented ways that turn ordinary code errors into user‑facing crises. Companies building on third‑party APIs must treat refresh tokens as immutable assets, embed provider‑specific safeguards, and monitor rotation anomalies in real time. Failure to do so will continue to generate costly re‑authorizations and erode user trust.
Sources: Hacker News – What we learned operating auth for 1k APIs