Relates to #2750 — Phase 1 migration.
Goal
Create a new mining-sources Supabase Edge Function (Hono-based) that handles OAuth URL generation and callback for Google/Microsoft providers. Consolidate the duplicated OAuth clients currently in both the Express backend and fetch-mining-source edge function.
Endpoints
| Method |
Path |
Purpose |
| POST |
/:provider |
Generate OAuth authorization URL with state |
| GET |
/callback/:provider |
Exchange OAuth code for tokens, upsert source |
Files to create
- supabase/functions/mining-sources/index.ts — Hono app
- supabase/functions/mining-sources/oauth-handler/ — move from fetch-mining-source
Files to modify
- frontend/src/utils/oauth.ts
- frontend/src/pages/sources.vue
- frontend/src/components/campaigns/CampaignComposerDialog.vue
Files to remove
- backend/src/services/OAuth2/ (entire directory)
- backend/src/controllers/mining.controller.ts:192-241
- backend/src/routes/mining.routes.ts:40-48
Acceptance criteria
Relates to #2750 — Phase 1 migration.
Goal
Create a new mining-sources Supabase Edge Function (Hono-based) that handles OAuth URL generation and callback for Google/Microsoft providers. Consolidate the duplicated OAuth clients currently in both the Express backend and fetch-mining-source edge function.
Endpoints
Files to create
Files to modify
Files to remove
Acceptance criteria