Add rack 2 check
This commit is contained in:
parent
9184d30f6c
commit
bfe063f12a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue