fix(mothership): connect integrations from chat without state_mismatch#4848
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview That route enforces session, validates query via Draft creation and direct provider redirects were removed from Reviewed by Cursor Bugbot for commit 10f1085. Configure here. |
Greptile SummaryThis PR fixes the
Confidence Score: 5/5Safe to merge — the change is a targeted, well-reasoned fix with correct session checks, workspace access enforcement, and same-origin callbackURL validation throughout. The new authorize endpoint is properly guarded: authenticated session required, workspace write access checked, callbackURL validated to be same-origin, and all error paths redirect gracefully. The copilot handler simplification removes the server-side auth call that was the source of the bug. No identified correctness issues in the changed code. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix draft timing issue" | Re-trigger Greptile |
|
@greptile |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 10f1085. Configure here.
Summary
GET /api/auth/oauth2/authorizethat runsoAuth2LinkAccountinside the user's browser request, forwards thestatecookie, and redirects to the provideroauth_get_auth_linkhandler (lib/copilot/tools/handlers/oauth.ts) at that endpoint instead of building the provider URL server-side.skipStateCookieCheck— Better Auth's state-cookie CSRF protection stays enabled for all flows (incl. social login).Type of Change
Testing
Tested manually
Checklist