Commit 8e83df5
Lasim
feat(all): implement OAuth pending flows to prevent orphaned installations
Replaced immediate installation creation with two-phase OAuth flow:
- New oauthPendingFlows table stores temporary OAuth state (10-min expiry)
- Authorize endpoint creates flow instead of installation with oauth_pending=true
- Callback endpoint creates installation only after successful OAuth completion
- Cleanup cron job runs every 3 minutes to delete expired flows
Backend changes:
- Add oauthPendingFlows table with indexes for state and expiration
- Update authorize.ts to create flows with flow_id instead of installation_id
- Update callback.ts route from /installations/:installationId/oauth/callback to /oauth/callback/:flowId
- Add CleanupExpiredOAuthPendingFlowsWorker and cron job
- Update response schemas to use flow_id instead of installation_id
Frontend changes:
- Update mcpInstallationService.ts to handle flow_id response
- Update McpServerInstallWizard.vue to use flow_id for completion
Database migration: 0010_young_jimmy_woo.sql
Fixes issue where closing OAuth popup created orphaned installations.
Installations now only exist after successful OAuth authorization.1 parent a3ce748 commit 8e83df5
File tree
16 files changed
+6411
-186
lines changed- services
- backend
- drizzle/migrations
- meta
- src
- cron
- jobs
- db
- schema-tables
- routes/mcp/installations
- workers
- frontend/src
- components/mcp-server/wizard
- services
16 files changed
+6411
-186
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26096 | 26096 | | |
26097 | 26097 | | |
26098 | 26098 | | |
26099 | | - | |
| 26099 | + | |
26100 | 26100 | | |
26101 | | - | |
| 26101 | + | |
26102 | 26102 | | |
26103 | 26103 | | |
26104 | 26104 | | |
| |||
26116 | 26116 | | |
26117 | 26117 | | |
26118 | 26118 | | |
26119 | | - | |
| 26119 | + | |
26120 | 26120 | | |
26121 | 26121 | | |
26122 | 26122 | | |
| |||
26259 | 26259 | | |
26260 | 26260 | | |
26261 | 26261 | | |
26262 | | - | |
| 26262 | + | |
26263 | 26263 | | |
26264 | 26264 | | |
26265 | 26265 | | |
| |||
26311 | 26311 | | |
26312 | 26312 | | |
26313 | 26313 | | |
26314 | | - | |
| 26314 | + | |
26315 | 26315 | | |
26316 | 26316 | | |
26317 | 26317 | | |
26318 | 26318 | | |
26319 | 26319 | | |
26320 | 26320 | | |
26321 | 26321 | | |
26322 | | - | |
| 26322 | + | |
26323 | 26323 | | |
26324 | | - | |
| 26324 | + | |
26325 | 26325 | | |
26326 | 26326 | | |
26327 | 26327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18506 | 18506 | | |
18507 | 18507 | | |
18508 | 18508 | | |
18509 | | - | |
| 18509 | + | |
18510 | 18510 | | |
18511 | | - | |
| 18511 | + | |
18512 | 18512 | | |
18513 | 18513 | | |
18514 | 18514 | | |
| |||
18522 | 18522 | | |
18523 | 18523 | | |
18524 | 18524 | | |
18525 | | - | |
| 18525 | + | |
18526 | 18526 | | |
18527 | 18527 | | |
18528 | 18528 | | |
| |||
18617 | 18617 | | |
18618 | 18618 | | |
18619 | 18619 | | |
18620 | | - | |
| 18620 | + | |
18621 | 18621 | | |
18622 | 18622 | | |
18623 | 18623 | | |
| |||
18654 | 18654 | | |
18655 | 18655 | | |
18656 | 18656 | | |
18657 | | - | |
| 18657 | + | |
18658 | 18658 | | |
18659 | 18659 | | |
18660 | 18660 | | |
18661 | 18661 | | |
18662 | | - | |
| 18662 | + | |
18663 | 18663 | | |
18664 | | - | |
| 18664 | + | |
18665 | 18665 | | |
18666 | 18666 | | |
18667 | 18667 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments