Auth Issue: Vercel deployment with GitHub PKCE backend incorrectly redirects to Netlify auth
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Hello Decap team,
I'm encountering a persistent authentication issue. My setup works perfectly on `localhost`, but on the Vercel production deployment, clicking "Login with GitHub" always redirects to `api.netlify.com/auth` instead of the GitHub OAuth flow.
**Environment:**
- **Hosting:** Vercel
- **Framework:** Next.js (App Router)
- **Live Site Admin:** `https://gaianata.id/admin/`
- **Public Repository:** `https://github.com/adistaanugrah/gaianata`
**What I've Done:**
- Configured `backend: github` with `auth_type: pkce`.
- Created separate, correctly configured OAuth Apps for both `localhost` and the production domain (`gaianata.id`).
- Verified that the production `config.yml` with the correct production `app_id` is live on the server by accessing it directly.
- Tried multiple exhaustive cache clearing methods (Hard Reload, Incognito, disabling cache in DevTools, redeploying without build cache).
- Locked the Decap CMS script to a specific stable version (`3.1.1`).
- As a final test, I am now self-hosting the `decap-cms.js` script to eliminate any CDN issues.
Despite all these steps, the production site continues to redirect to Netlify's auth endpoint, while `localhost` works as expected. This suggests a potential bug in how the script handles configuration in a production environment on Vercel.
Any insights would be greatly appreciated. Thank you.
Contributor guide
Assessment
This issue has not been assessed yet.