X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/56aefb8dcd86aca391285abf84eb53f3e3e03572..945d60ea5a52d0c1d41cc63456bd6f60e547e79e:/vendor/plugins/open_id_authentication/init.rb?ds=sidebyside diff --git a/vendor/plugins/open_id_authentication/init.rb b/vendor/plugins/open_id_authentication/init.rb index 808c7bdbd..84ec11fc4 100644 --- a/vendor/plugins/open_id_authentication/init.rb +++ b/vendor/plugins/open_id_authentication/init.rb @@ -1,18 +1,12 @@ -if config.respond_to?(:gems) - config.gem 'ruby-openid', :lib => 'openid', :version => '>=2.0.4' -else - begin - require 'openid' - rescue LoadError - begin - gem 'ruby-openid', '>=2.0.4' - rescue Gem::LoadError - puts "Install the ruby-openid gem to enable OpenID support" - end - end +if Rails.version < '3' + config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1' end -config.to_prepare do +require 'open_id_authentication' + +config.middleware.use OpenIdAuthentication + +config.after_initialize do OpenID::Util.logger = Rails.logger ActionController::Base.send :include, OpenIdAuthentication end