I’m trying to get Netlify CMS to work on Vercel with Next.js.
To do this I’ve created two API routes in my Next.js, one for Auth that redirect me to Github, and a callback.
Both of these work without any further setup when developing locally, but as soon as my site is live on Vercel, the Login with Github
button on Netlify CMS redirects me to api.netlify.com
.
Could someone explain to me why that’s happening?
The following config
works locally, but not in production:
backend:
name: github
repo: creativiii/wordpress-react
branch: feature/netlify-cms
I’ve tried a bunch of combinations of configs with base_url
, auth_endpoint
and api_root
but none of them have worked.
Any tips on how to get the Login with Github
button to simply redirect me to https://<current-domain>/api/auth
?
Is there also any way to use a JS file for the CMS’ config rather than a yaml one? I think this could be easy to fix if I could use env variables.