omniauth-facebook 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/config.ru +1 -6
- data/lib/omniauth/facebook/version.rb +1 -1
- data/lib/omniauth/strategies/facebook.rb +2 -8
- data/test/test.rb +0 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6df31b397c5361d54234d354ee57e9b04ee60d47
|
4
|
+
data.tar.gz: a7ab41bed0a9fa303660f05e8982e71bca05f31e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964b27002810318b96b5bc82d44ed4ee8fcff75783711e32ddabd939521474c5bed352932a8ae10d5e5382e7c66a45dd04bf0125a3bba710f6e6292b7cd26375
|
7
|
+
data.tar.gz: cd32aa970b991a00984d1fd8b2ec730b56682872d64550bb2f6da7c9c4e44b0d8683b3eb60282bb52d34cf1bc7b71ee36b15fb1892ad72aaa4d8d6115856c7fe
|
data/example/config.ru
CHANGED
@@ -87,15 +87,10 @@ class App < Sinatra::Base
|
|
87
87
|
# signed_request FB sends us, asking for auth if the user has
|
88
88
|
# not already granted access, or simply moving straight to the
|
89
89
|
# callback where they have already granted access.
|
90
|
-
|
91
|
-
# we pass the state parameter which we can detect in our callback
|
92
|
-
# to do custom rendering/redirection for the canvas app page
|
93
|
-
redirect "/auth/facebook?signed_request=#{request.params['signed_request']}&state=canvas"
|
90
|
+
redirect "/auth/facebook?signed_request=#{request.params['signed_request']}"
|
94
91
|
end
|
95
92
|
|
96
93
|
get '/auth/:provider/callback' do
|
97
|
-
# we can do something special here is +state+ param is canvas
|
98
|
-
# (see notes above in /canvas/ method for more details)
|
99
94
|
content_type 'application/json'
|
100
95
|
MultiJson.encode(request.env)
|
101
96
|
end
|
@@ -57,12 +57,7 @@ module OmniAuth
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def build_access_token
|
60
|
-
if
|
61
|
-
::OAuth2::AccessToken.from_hash(
|
62
|
-
client,
|
63
|
-
{"access_token" => access_token}.update(access_token_options)
|
64
|
-
)
|
65
|
-
elsif signed_request_contains_access_token?
|
60
|
+
if signed_request_contains_access_token?
|
66
61
|
hash = signed_request.clone
|
67
62
|
::OAuth2::AccessToken.new(
|
68
63
|
client,
|
@@ -81,7 +76,6 @@ module OmniAuth
|
|
81
76
|
# if we already have an access token, we can just hit the
|
82
77
|
# callback URL directly and pass the signed request along
|
83
78
|
params = { :signed_request => raw_signed_request }
|
84
|
-
params[:state] = request.params['state'] if request.params['state']
|
85
79
|
query = Rack::Utils.build_query(params)
|
86
80
|
|
87
81
|
url = callback_url
|
@@ -116,7 +110,7 @@ module OmniAuth
|
|
116
110
|
# you need to set them dynamically. You can also set these options
|
117
111
|
# in the OmniAuth config :authorize_params option.
|
118
112
|
#
|
119
|
-
# /auth/facebook?display=popup
|
113
|
+
# /auth/facebook?display=popup
|
120
114
|
#
|
121
115
|
def authorize_params
|
122
116
|
super.tap do |params|
|
data/test/test.rb
CHANGED
@@ -469,20 +469,4 @@ module BuildAccessTokenTests
|
|
469
469
|
assert_equal @payload['expires'], result.expires_at
|
470
470
|
end
|
471
471
|
end
|
472
|
-
|
473
|
-
class ParamsContainAccessTokenStringTest < TestCase
|
474
|
-
def setup
|
475
|
-
super
|
476
|
-
|
477
|
-
@request.stubs(:params).returns({'access_token' => 'm4c0d3z'})
|
478
|
-
|
479
|
-
strategy.stubs(:callback_url).returns('/')
|
480
|
-
end
|
481
|
-
|
482
|
-
test 'returns a new access token' do
|
483
|
-
result = strategy.build_access_token
|
484
|
-
assert_kind_of ::OAuth2::AccessToken, result
|
485
|
-
assert_equal 'm4c0d3z', result.token
|
486
|
-
end
|
487
|
-
end
|
488
472
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-facebook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|