[Solved] /admin/ needs public git gateway repo access to Log In

Hi, tried to make the Github repo private, but then couldn’t log in to my admin section.
Is there a way to make the repo private and still allow Log In to Admin?

1 Like

You’ll need to regenerate your token: https://docs.netlify.com/visitor-access/git-gateway/#getting-started

RECONNECT AFTER CHANGING REPOSITORY PERMISSIONS

If you change ownership on your repository, or convert a repository from public to private, you may need to reconnect Git Gateway with proper permissions:

  • Go to Settings > Build & deploy > Continuous Deployment > Build settings to re-link the repository.
  • Go to Settings > Identity > Services > Git Gateway to add a new API access token following the instructions in the section above.
4 Likes

Thanks! that solved it :+1:

1 Like

I had the same problem and getting the following in the JavaScript console when trying to sign in to Netlify CMS admin.

Problem fetching repo data from Git Gateway [GitHubAPI.js:44:16](webpack://NetlifyCms/.-backend-git-gateway/dist/esm/GitHubAPI.js)

hasWriteAccess GitHubAPI.js:44

API_ERROR: "Not Found"

cms %5E2.0.0/dist/netlify-cms.js:48
cms %5E2.0.0/dist/netlify-cms.js:48
cms %5E2.0.0/dist/netlify-cms.js:130
cms %5E2.0.0/dist/netlify-cms.js:40
[auth.js:111:14](webpack://NetlifyCms/.-core/dist/esm/actions/auth.js)

The solution of recreating Git Gateway solved it - apparently changed permission on Github side triggers this.

thanks for sharing your workaround, @miohtama!