omniauth-odnoklassniki 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/odnoklassniki.rb +7 -10
- data/lib/omniauth-odnoklassniki/version.rb +1 -1
- 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: b9f66d9ad84a060a92fcadee0e6240da7286488c
|
4
|
+
data.tar.gz: 978167e78ec1b57e75b95dc8d0f70cb14a01b305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9769bbe8cac5453ce611e836b53a8f013ba070b47d880fb7751b7d0c1e06f83a870c5a2747886bafbe8cef98ca65605ca5afa6bfcf62674cf2a5999da266db0f
|
7
|
+
data.tar.gz: 20fddb909a46ed2d203596512c0ed4af89601339013d582604be9aef860762b2e4413e86b29415693afe74af3d9ab97c15913ed640315bce09616a81a1df4063
|
@@ -8,7 +8,7 @@ module OmniAuth
|
|
8
8
|
|
9
9
|
option :client_options, {
|
10
10
|
:site => 'http://www.odnoklassniki.ru/',
|
11
|
-
:token_url => '
|
11
|
+
:token_url => 'https://api.odnoklassniki.ru/oauth/token.do',
|
12
12
|
:authorize_url => '/oauth/authorize'
|
13
13
|
}
|
14
14
|
|
@@ -48,13 +48,9 @@ module OmniAuth
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def build_access_token
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
def access_token_options
|
57
|
-
options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
|
51
|
+
verifier = request.params['code']
|
52
|
+
client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)),
|
53
|
+
{'expires' => 1800}.merge(options.access_token_options.to_hash(:symbolize_keys => true)))
|
58
54
|
end
|
59
55
|
|
60
56
|
private
|
@@ -70,9 +66,10 @@ module OmniAuth
|
|
70
66
|
'method' => 'users.getCurrentUser',
|
71
67
|
'application_key' => options.public_key
|
72
68
|
}
|
73
|
-
params['scope'] = URI::encode(options.scope) if options.scope
|
74
69
|
params['sig'] = calculate_signature(params)
|
75
|
-
access_token.get('http://api.odnoklassniki.ru/fb.do', :params => params).parsed
|
70
|
+
result = access_token.get('http://api.odnoklassniki.ru/fb.do', :params => params).parsed
|
71
|
+
raise CallbackError.new(nil, :invalid_response) if result['error_code'] || result['error_msg']
|
72
|
+
result
|
76
73
|
end
|
77
74
|
end
|
78
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-odnoklassniki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Logvinov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|