Decap CMS OAuth Proxy — Cloudflare Worker
Handles the GitHub OAuth handshake for Decap CMS’s backend: github mode.
Deploy worker.js via the Cloudflare dashboard (Workers & Pages → Create → paste this code).
Deployment order (see chat history for full walkthrough)
- Create the Worker in Cloudflare, paste
worker.js, deploy — note the resulting URL (e.g.https://something.workers.dev) - Create a GitHub OAuth App using that Worker’s URL +
/callbackas the Authorization callback URL - Copy the OAuth App’s Client ID and Client Secret into the Worker’s Settings → Variables and Secrets as
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET - Update
admin/config.yml’sbase_urlin the main site repo to the Worker’s URL