rack-oauth_echo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/oauth_echo.rb +3 -3
- data/lib/rack/oauth_echo/version.rb +1 -1
- metadata +1 -1
data/lib/rack/oauth_echo.rb
CHANGED
@@ -8,8 +8,8 @@ module Rack
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call(env)
|
11
|
-
if
|
12
|
-
json_response = auth_request(env)
|
11
|
+
if auth_header?(env)
|
12
|
+
json_response = auth_request(env)
|
13
13
|
if json_response.status == 200
|
14
14
|
env['rack-oauth_echo.user_hash'] = auth_request(env).body
|
15
15
|
@app.call(env)
|
@@ -23,7 +23,7 @@ module Rack
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
-
def
|
26
|
+
def auth_header?(env)
|
27
27
|
env.has_key?('X-Verify-Credentials-Authorization') ||
|
28
28
|
env.has_key?('X-Auth-Service-Provider')
|
29
29
|
end
|