File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33GitHub Pages is static, and GitHub's OAuth token endpoint (` https://github.com/login/oauth/access_token ` ) is ** not CORS-enabled** .
44So a browser-only PKCE flow cannot exchange ` code ` -> ` access_token ` directly.
55
6- This proxy performs ** token exchange server-side** (still PKCE, no ` client_secret ` required ), and returns JSON with CORS enabled.
6+ This proxy performs ** token exchange server-side** (still PKCE), and returns JSON with CORS enabled.
77
88## Deploy (Cloudflare Worker)
99
@@ -28,3 +28,16 @@ wrangler deploy
2828
2929On GitHub Actions Pages build, you can add ` PUBLIC_GITHUB_OAUTH_PROXY_URL ` as a repository variable or secret and wire it into the build step.
3030
31+ ## Optional hardening (recommended)
32+
33+ You can bind a GitHub OAuth app secret to the worker (kept server-side):
34+
35+ ``` bash
36+ wrangler secret put GITHUB_CLIENT_SECRET
37+ ```
38+
39+ Optionally, lock the worker to a single GitHub client id:
40+
41+ ``` bash
42+ wrangler secret put GITHUB_CLIENT_ID
43+ ```
You can’t perform that action at this time.
0 commit comments