omniauth-vkontakte 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/examples/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+
3
+ gem 'sinatra'
4
+ gem 'omniauth-vkontakte', :path => '../'
data/examples/sinatra.rb CHANGED
@@ -6,10 +6,12 @@ require 'sinatra'
6
6
  require 'omniauth'
7
7
  require 'omniauth-vkontakte'
8
8
 
9
+ SCOPE = 'friends,audio'
10
+
9
11
  use Rack::Session::Cookie
10
12
 
11
13
  use OmniAuth::Builder do
12
- provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET']
14
+ provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'], :scope => SCOPE
13
15
  end
14
16
 
15
17
  get '/' do
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Vkontakte
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -11,6 +11,8 @@ module OmniAuth
11
11
  # @example Basic Usage
12
12
  # use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'
13
13
  class Vkontakte < OmniAuth::Strategies::OAuth2
14
+ DEFAULT_SCOPE = ''
15
+
14
16
  option :name, 'vkontakte'
15
17
 
16
18
  option :client_options, {
@@ -50,6 +52,12 @@ module OmniAuth
50
52
  @raw_info ||= access_token.get('/method/getProfiles', :params => { :uid => uid, :fields => fields.join(',') }).parsed["response"].first
51
53
  end
52
54
 
55
+ def authorize_params
56
+ super.tap do |params|
57
+ params[:scope] ||= DEFAULT_SCOPE
58
+ end
59
+ end
60
+
53
61
  private
54
62
 
55
63
  # http://vkontakte.ru/developers.php?o=-17680044&p=getCountries
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-vkontakte
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-08 00:00:00.000000000 Z
12
+ date: 2011-12-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &81191690 !ruby/object:Gem::Requirement
16
+ requirement: &78864210 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *81191690
24
+ version_requirements: *78864210
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth2
27
- requirement: &81191120 !ruby/object:Gem::Requirement
27
+ requirement: &78863950 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *81191120
35
+ version_requirements: *78863950
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_json
38
- requirement: &81190800 !ruby/object:Gem::Requirement
38
+ requirement: &78863760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *81190800
46
+ version_requirements: *78863760
47
47
  description: Unofficial VKontakte strategy for OmniAuth 1.0
48
48
  email:
49
49
  - anton.linux@gmail.com
@@ -53,6 +53,7 @@ extra_rdoc_files: []
53
53
  files:
54
54
  - README.md
55
55
  - Rakefile
56
+ - examples/Gemfile
56
57
  - examples/sinatra.rb
57
58
  - lib/omniauth-vkontakte.rb
58
59
  - lib/omniauth-vkontakte/version.rb
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  requirements: []
80
81
  rubyforge_project:
81
- rubygems_version: 1.8.10
82
+ rubygems_version: 1.8.6
82
83
  signing_key:
83
84
  specification_version: 3
84
85
  summary: Unofficial VKontakte strategy for OmniAuth 1.0