diff options
author | Stan Hu <stanhu@gmail.com> | 2018-12-10 11:52:04 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-12-10 11:56:14 -0800 |
commit | b4e2679437558e48c9055ac499ce775cce9b191d (patch) | |
tree | 4bbaa5269b7f4e2373184f0eed2474d93a52a186 /app/controllers/import | |
parent | eadd53b969da2704d7551069eda0b416ffb7b0e2 (diff) | |
download | gitlab-ce-b4e2679437558e48c9055ac499ce775cce9b191d.tar.gz |
Allow GitHub imports via token even if OAuth2 provider not configured
Previously, the GitHub importer would only work if the site configured
an OAuth2 provider were configured. Users attempting to import via a
GitHub personal access token would see an Error 500 due to a failed
redirection. We fix this by only doing the redirection if the provider
has been configured and allowing users to see the new import page.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/38524
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/github_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb index 58565aaf8c9..d4c26fa0709 100644 --- a/app/controllers/import/github_controller.rb +++ b/app/controllers/import/github_controller.rb @@ -7,7 +7,7 @@ class Import::GithubController < Import::BaseController rescue_from Octokit::Unauthorized, with: :provider_unauthorized def new - if logged_in_with_provider? + if github_import_configured? && logged_in_with_provider? go_to_provider_for_permissions elsif session[access_token_key] redirect_to status_import_url |