Error 500 "OAuth configuration for GitHub missing" when clicking "List your GitHub repositories" on the import page

When on the GitHub import page (e.g. https://gitlab.com/import/github/new), if you click the "List your GitHub Repositories" button without entering an access token and OAuth is not configured, you get a 500 error "OAuth configuration for GitHub missing".

github-import-bug-when-no-access-token-given

That's because in app/controllers/import/github_controller.rb#provider_auth we try to authenticate with OAuth if there's no token in the session, without checking first that OAuth is configured.

I think we should do 2 things:

  • make the field mandatory on the frontend and show an error if it's blank
  • make the field mandatory on the backend and show an error if it's blank and OAuth is not configured
Edited Jul 12, 2018 by Rémy Coutable
Assignee Loading
Time tracking Loading