diff --git a/lib/omniauth/builder.rb b/lib/omniauth/builder.rb index 0407660..fd6591b 100644 --- a/lib/omniauth/builder.rb +++ b/lib/omniauth/builder.rb @@ -2,7 +2,7 @@ module OmniAuth class Builder < ::Rack::Builder def initialize(app, &block) @options = nil - if rack14? + if rack14? || rack2? super else @app = app @@ -15,6 +15,10 @@ module OmniAuth Rack.release.split('.')[1].to_i >= 4 end + def rack2? + Rack.release.start_with? '2.' + end + def on_failure(&block) OmniAuth.config.on_failure = block end