diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-07-26 11:57:05 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-24 17:33:53 +0200 |
commit | f8865e9c1303be7302306bea9dd1057bf3b3f608 (patch) | |
tree | 6dadf2a46c163a43c2acc2e3521657e65386dedf /app/controllers/omniauth_callbacks_controller.rb | |
parent | 88892e43adecd68de7940fdc9856a4557098cb6c (diff) | |
download | gitlab-ce-f8865e9c1303be7302306bea9dd1057bf3b3f608.tar.gz |
Define ldap methods at runtime
This avoids loading the `OmniAuthCallbacksController` at boot time so
it doesn't mess up the `before_action`-chain
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 7444826a5d1..9612b8d8514 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -10,6 +10,14 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController end end + if Gitlab::LDAP::Config.enabled? + Gitlab::LDAP::Config.available_servers.each do |server| + define_method server['provider_name'] do + ldap + end + end + end + # Extend the standard message generation to accept our custom exception def failure_message exception = env["omniauth.error"] |