Move dynamic omniauth declarations to initializer
This commit is contained in:
parent
93505f7d04
commit
fc5bfd1dc1
|
@ -32,10 +32,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||
end
|
||||
end
|
||||
|
||||
Gitlab.config.ldap.servers.each do |server|
|
||||
alias_method server.provider_name, :ldap
|
||||
end
|
||||
|
||||
def omniauth_error
|
||||
@provider = params[:provider]
|
||||
@error = params[:error]
|
||||
|
|
|
@ -2,3 +2,8 @@ module OmniAuth::Strategies
|
|||
server = Gitlab.config.ldap.servers.first
|
||||
const_set(server.provider_class, Class.new(LDAP))
|
||||
end
|
||||
|
||||
OmniauthCallbacksController.class_eval do
|
||||
server = Gitlab.config.ldap.servers.first
|
||||
alias_method server.provider_name, :ldap
|
||||
end
|
Loading…
Reference in New Issue