diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 1f7682c97..501a3eeeb 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,3 +1,9 @@ +Dir[ Rails.root.join('lib', 'omniauth', '*') ].each do |file| + if File.file?(file) + require file + end +end + Rails.application.config.middleware.use OmniAuth::Builder do # twitter database connect diff --git a/config/initializers/vendor_lib.rb b/config/initializers/vendor_lib.rb deleted file mode 100644 index 73c004c7a..000000000 --- a/config/initializers/vendor_lib.rb +++ /dev/null @@ -1,6 +0,0 @@ -# load all vendor/lib extentions -Dir[ Rails.root.join('vendor', 'lib', '*') ].each do |file| - if File.file?(file) - require file - end -end diff --git a/vendor/lib/facebook_database.rb b/lib/omniauth/facebook_database.rb similarity index 100% rename from vendor/lib/facebook_database.rb rename to lib/omniauth/facebook_database.rb diff --git a/vendor/lib/github_database.rb b/lib/omniauth/github_database.rb similarity index 100% rename from vendor/lib/github_database.rb rename to lib/omniauth/github_database.rb diff --git a/vendor/lib/gitlab_database.rb b/lib/omniauth/gitlab_database.rb similarity index 100% rename from vendor/lib/gitlab_database.rb rename to lib/omniauth/gitlab_database.rb diff --git a/vendor/lib/google_oauth2_database.rb b/lib/omniauth/google_oauth2_database.rb similarity index 100% rename from vendor/lib/google_oauth2_database.rb rename to lib/omniauth/google_oauth2_database.rb diff --git a/vendor/lib/linked_in_database.rb b/lib/omniauth/linked_in_database.rb similarity index 100% rename from vendor/lib/linked_in_database.rb rename to lib/omniauth/linked_in_database.rb diff --git a/vendor/lib/microsoft_office365_database.rb b/lib/omniauth/microsoft_office365_database.rb similarity index 100% rename from vendor/lib/microsoft_office365_database.rb rename to lib/omniauth/microsoft_office365_database.rb diff --git a/vendor/lib/oauth2_database.rb b/lib/omniauth/oauth2_database.rb similarity index 100% rename from vendor/lib/oauth2_database.rb rename to lib/omniauth/oauth2_database.rb diff --git a/vendor/lib/saml_database.rb b/lib/omniauth/saml_database.rb similarity index 69% rename from vendor/lib/saml_database.rb rename to lib/omniauth/saml_database.rb index 766dbd937..377f62327 100644 --- a/vendor/lib/saml_database.rb +++ b/lib/omniauth/saml_database.rb @@ -12,11 +12,11 @@ class SamlDatabase < OmniAuth::Strategies::SAML assertion_consumer_service_url = "#{http_type}://#{fqdn}/auth/saml/callback" config = Setting.get('auth_saml_credentials') || {} - options = config.reject { |k,v| v.blank? } - .merge( - :assertion_consumer_service_url => assertion_consumer_service_url, - :issuer => entity_id, - ) + options = config.reject { |_k, v| v.blank? } + .merge( + assertion_consumer_service_url: assertion_consumer_service_url, + issuer: entity_id, + ) args[0] = options diff --git a/vendor/lib/twitter_database.rb b/lib/omniauth/twitter_database.rb similarity index 100% rename from vendor/lib/twitter_database.rb rename to lib/omniauth/twitter_database.rb diff --git a/vendor/lib/weibo_database.rb b/lib/omniauth/weibo_database.rb similarity index 100% rename from vendor/lib/weibo_database.rb rename to lib/omniauth/weibo_database.rb