omniauth-vkontakte 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/examples/sinatra.rb CHANGED
@@ -9,8 +9,7 @@ require 'omniauth-vkontakte'
9
9
  use Rack::Session::Cookie
10
10
 
11
11
  use OmniAuth::Builder do
12
- #provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET']
13
- provider :vkontakte, '1915108', 'BsCEIfRxoDFZU8vZJ65v'
12
+ provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET']
14
13
  end
15
14
 
16
15
  get '/' do
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Vkontakte
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -25,21 +25,27 @@ module OmniAuth
25
25
 
26
26
  uid { access_token.params['user_id'] }
27
27
 
28
+ # https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema
28
29
  info do
29
30
  {
31
+ :nickname => raw_info['nickname'],
30
32
  :first_name => raw_info['first_name'],
31
- :last_name => raw_info['last_name']
33
+ :last_name => raw_info['last_name'],
34
+ :image => raw_info['image'],
35
+ :urls => {
36
+ 'Vkontakte' => "http://vk.com/#{raw_info['domain']}"
37
+ }
32
38
  }
33
39
  end
34
40
 
35
41
  extra do
36
- {'raw_info' => raw_info}
42
+ { 'raw_info' => raw_info }
37
43
  end
38
44
 
39
45
  def raw_info
40
46
  # http://vkontakte.ru/developers.php?o=-17680044&p=Description+of+Fields+of+the+fields+Parameter
41
47
  fields = ['uid', 'first_name', 'last_name', 'nickname', 'domain', 'sex', 'bdate', 'city', 'country', 'timezone', 'photo', 'photo_big']
42
- access_token.get('/method/getProfiles', :params => {:uid => uid, :fields => fields.join(',')}).parsed["response"].first
48
+ access_token.get('/method/getProfiles', :params => { :uid => uid, :fields => fields.join(',') }).parsed["response"].first
43
49
  end
44
50
  end
45
51
  end
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.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &73123550 !ruby/object:Gem::Requirement
16
+ requirement: &84808660 !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: *73123550
24
+ version_requirements: *84808660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth2
27
- requirement: &73123260 !ruby/object:Gem::Requirement
27
+ requirement: &84808410 !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: *73123260
35
+ version_requirements: *84808410
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_json
38
- requirement: &73123020 !ruby/object:Gem::Requirement
38
+ requirement: &84808150 !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: *73123020
46
+ version_requirements: *84808150
47
47
  description: Unofficial VKontakte strategy for OmniAuth 1.0
48
48
  email:
49
49
  - anton.linux@gmail.com