Skip to content
This repository was archived by the owner on Sep 10, 2026. It is now read-only.

Commit ec10b48

Browse files
committed
wip
1 parent aa636ac commit ec10b48

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎TODO.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Websim to GitHub Export Plan
22

3+
## Authentication (GitHub App OAuth)
4+
5+
### Flow
6+
7+
1. User clicks "Connect GitHub" in modal
8+
2. Redirect to GitHub authorization: `https://github.com/apps/{app_slug}/installations/new`
9+
3. User authorizes → GitHub redirects to `/api/auth/callback?code={code}`
10+
4. Cloudflare Worker exchanges code for access_token via GitHub API
11+
5. Token returned to userscript and stored via `GM.setValue`
12+
13+
### Userscript Storage
14+
15+
- Key: `github_token`
16+
- Use `await GM.setValue('github_token', token)`
17+
- Retrieve with `await GM.getValue('github_token')`
18+
19+
### API Routes (Cloudflare Worker)
20+
21+
- `GET /api/auth/login` → Initiates OAuth flow (redirects to GitHub)
22+
- `GET /api/auth/callback?code={code}` → Exchanges code for token, returns to userscript
23+
24+
### Environment Variables
25+
26+
- `GITHUB_APP_CLIENT_ID`
27+
- `GITHUB_APP_CLIENT_SECRET`
28+
329
## How to get source code from Websim
430

531
GET `https://websim.com/api/v1/projects/{project_id}/revisions/{revision_id}/assets`

‎src/pages/api/auth/callback.ts‎

Whitespace-only changes.

‎src/pages/api/auth/login.ts‎

Whitespace-only changes.

0 commit comments

Comments
 (0)