Stateless Cloudflare Worker that forwards POST /device/code and POST /access_token
to GitHub’s device-flow endpoints. Exists only because those endpoints don’t support
CORS, so a static page can’t call them directly from the browser. Holds no secrets —
device flow for public GitHub OAuth Apps only needs the Client ID, which the browser
already sends.
cd demo/oauth-proxy
npx wrangler login
npx wrangler deploy
This prints a *.workers.dev URL. Then:
OAUTH_PROXY_URL in demo/github-upload.jsCLIENT_ID in the same file (see the
file’s header comment for how to register the OAuth App)https://digital-ai.github.io, update
ALLOWED_ORIGIN in wrangler.toml to match