negval-omniauth-yandex 0.0.2lite → 0.0.2lite1

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.
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Yandex
3
- VERSION = "0.0.2lite"
3
+ VERSION = "0.0.2lite1"
4
4
  end
5
5
  end
@@ -16,14 +16,19 @@ module OmniAuth
16
16
  :authorize_url => '/authorize'
17
17
  }
18
18
 
19
- uid do
20
- raw_info[:uid]
21
- end
19
+ uid { raw_info['id'] }
22
20
 
23
21
  extra do
24
22
  {:raw_info => raw_info}
25
23
  end
26
24
 
25
+ info do
26
+ {'nickname' => raw_info['display_name'],
27
+ 'email' => raw_info['default_email'],
28
+ 'name' => raw_info['real_name']
29
+ }.delete_if{ |_,v| v.nil?||v.respond_to?(:empty?)&&v.empty? }
30
+ end
31
+
27
32
  def callback_url
28
33
  if options.authorize_options.respond_to? :callback_url
29
34
  options.authorize_options.callback_url
@@ -36,16 +41,10 @@ module OmniAuth
36
41
 
37
42
  def raw_info
38
43
  @raw_info ||= begin
39
- # Get user info from Ya.ru API
40
- # http://api.yandex.ru/yaru/doc/ref/concepts/discovery.xml
41
- json_data = access_token.get("https://login.yandex.ru/info?format=json").body
42
- data = JSON.parse(json_data)
43
- {
44
- :uid => data["id"],
45
- }
44
+ # Get user info from Yandex.login API
45
+ JSON.parse access_token.get("https://login.yandex.ru/info?format=json").body
46
46
  end
47
47
  end
48
-
49
48
  end
50
49
  end
51
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: negval-omniauth-yandex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2lite
4
+ version: 0.0.2lite1
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors: