From 0698c1f4d0152036a395031e29f03efe179408fa Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 24 Jul 2017 14:53:30 +0200 Subject: Load the sessionscontroller after loading the ldap strategies --- config/initializers/omniauth.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index f7fa6d1c2de..90d79bae466 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -9,6 +9,13 @@ if Gitlab::LDAP::Config.enabled? server = Gitlab.config.ldap.servers.values.first alias_method server['provider_name'], :ldap end + + # We need to make sure we require the sessions controller _after_ we defined the + # nescessary LDAP-strategy classes. + # + # If we don't then the token gets cleared out at some point. + # + require Rails.root.join('app', 'controllers', 'sessions_controller') end OmniAuth.config.full_host = Settings.gitlab['base_url'] -- cgit v1.2.1