From 940d38b065e77ba2abcc21375c439f899450f852 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 16 Jun 2015 12:46:48 +0000 Subject: Merge branch 'require_kerberos_when_enabled' into 'master' If kerberos is enabled require it Since 'group: :kerberos' got [included in the Gemfile ](https://gitlab.com/gitlab-org/gitlab-ce/commit/2391a43a7073b4e723e9ca1f7ff19b30f8e51452) Kerberos no longer got [loaded when the app started](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/application.rb#L6) This caused `Devise::OmniAuth::StrategyNotFound` error once Kerberos is enabled, failing to start GitLab . With this we hopefully do not need to remove group from the Gemfile. See merge request !819 --- config/initializers/7_omniauth.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/initializers/7_omniauth.rb b/config/initializers/7_omniauth.rb index 6f1f267bf97..df73ec1304a 100644 --- a/config/initializers/7_omniauth.rb +++ b/config/initializers/7_omniauth.rb @@ -17,3 +17,11 @@ OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_s OmniAuth.config.before_request_phase do |env| OmniAuth::RequestForgeryProtection.new(env).call end + +if Gitlab.config.omniauth.enabled + Gitlab.config.omniauth.providers.each do |provider| + if provider['name'] == 'kerberos' + require 'omniauth-kerberos' + end + end +end -- cgit v1.2.1