-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(token-refresh): microsoft, notion, x, linear #2933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryFixes token refresh issues for Microsoft, Notion, X, and Linear OAuth providers by implementing proactive refresh for Microsoft's 90-day expiry and enabling refresh token rotation for providers that support it.
The proactive refresh mechanism checks if a Microsoft refresh token will expire within 7 days and triggers a refresh early to maintain continuous access. The rotation flag ensures that when providers issue new refresh tokens during the refresh flow, they are properly captured and stored. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Utils as OAuth Utils
participant OAuth as OAuth Service
participant DB as Database
participant Provider as OAuth Provider
Note over Client,Provider: Token Refresh Flow
Client->>Utils: Request credential access
Utils->>Utils: Check if access token expired
alt Microsoft Provider
Utils->>Utils: Check if refresh expires within 7 days
end
alt Token needs refresh
Utils->>OAuth: Call refreshOAuthToken
OAuth->>Provider: Send refresh request
Provider-->>OAuth: Return new credentials
alt Supports rotation
OAuth->>OAuth: Extract new refresh value
end
OAuth-->>Utils: Return refreshed credentials
alt Microsoft Provider
Utils->>Utils: Set refresh expiry to 90 days
end
Utils->>DB: Update account with new values
Utils-->>Client: Return valid credential
else Token valid
Utils-->>Client: Return existing credential
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
apps/sim/lib/oauth/oauth.ts, line 890-903 (link)logic: Missing
microsoft-excel,microsoft-planner, andmicrosoft-teamscases
3 files reviewed, 1 comment
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
Type of Change
Testing
Tested manually
Checklist