且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

服务器不会开始使用 authlogic-oauth2

更新时间:2023-11-28 08:48:40

安德鲁不再负责 authlogic-oauth2.对于更新的 gem,请尝试 https://github.com/robdimarco/authlogic_oauth2

The authlogic-oauth2 is no more taken care by Andrew. For the updated gem try https://github.com/robdimarco/authlogic_oauth2

Here the authlogic_oauth2.rb had been changed.
require File.dirname(__FILE__) + "/authlogic_oauth2/version"
require File.dirname(__FILE__) + "/authlogic_oauth2/oauth2_process"
require File.dirname(__FILE__) + "/authlogic_oauth2/acts_as_authentic"
require File.dirname(__FILE__) + "/authlogic_oauth2/session"
require File.dirname(__FILE__) + "/authlogic_oauth2/helper"
require File.dirname(__FILE__) + "/oauth2_callback_filter"

ActiveRecord::Base.send(:include, AuthlogicOauth2::ActsAsAuthentic)
Authlogic::Session::Base.send(:include, AuthlogicOauth2::Session)
ActionController::Base.helper AuthlogicOauth2::Helper

# Throw callback rack app into the middleware stack
if defined?(ActionController::Metal)
  module AuthlogicOAuth2
    class Railtie < Rails::Railtie
      initializer :load_oauth2_callback_filter do |app|
        app.config.middleware.use(Oauth2CallbackFilter) # Rails >= 3.0
      end
    end
  end
else
  ActionController::Dispatcher.middleware.use(Oauth2CallbackFilter) # Rails < 3.0
end

希望这能为您解决问题.

Hope this solves the problem for you.