Skip to content

Commit

Permalink
load the middleware the rails 3 way using a railtie
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldmartin committed Jul 1, 2010
1 parent 01c0629 commit 6b176bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/authlogic_oauth2.rb
Expand Up @@ -11,7 +11,13 @@

# Throw callback rack app into the middleware stack
if defined?(ActionController::Metal)
Rails.configuration.middleware.use(Oauth2CallbackFilter) # Rails >= 3.0
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

0 comments on commit 6b176bf

Please sign in to comment.