Add ldap callback definitions to initializer

parent c8616728
...@@ -32,10 +32,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -32,10 +32,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end end
end end
Gitlab.config.ldap.servers.each do |server|
alias_method server.provider_name, :ldap
end
def omniauth_error def omniauth_error
@provider = params[:provider] @provider = params[:provider]
@error = params[:error] @error = params[:error]
......
...@@ -4,3 +4,9 @@ module OmniAuth::Strategies ...@@ -4,3 +4,9 @@ module OmniAuth::Strategies
const_set(server.provider_class, Class.new(LDAP)) const_set(server.provider_class, Class.new(LDAP))
end end
end end
OmniauthCallbacksController.class_eval do
Gitlab.config.ldap.servers.each do |server|
alias_method server.provider_name, :ldap
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment