Cloudflare Worker for the GitDone login flow. The worker accepts an OAuth callback POST request, validates the payload, rate-limits requests per IP, and exchanges the code for a GitHub access token.
The worker expects these environment values:
CLIENT_IDCLIENT_SECRET
- Method:
POST - Content-Type:
application/json
Example body:
{
"code": "oauth_code_from_callback",
"code_verifier": "pkce_verifier"
}200 OK– GitHub OAuth response returned as JSON400 Bad Request– invalid JSON or missing fields405 Method Not Allowed– when the request is notPOST429 Too Many Requests– rate limit exceeded500 Internal Server Error– missing GitHub credentials
- Counted per IP address using
CF-Connecting-IP - Window: 10 minutes
- Maximum: 10 requests per IP per window