omniauth-yahoo 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c4585c76f1d494c5f15ffbaa1cec514d481a18d
4
- data.tar.gz: 1760f0fe037e493df4ea91e7d41f6fd6a8428f88
3
+ metadata.gz: 6a18c7aa2715f03b5456535f83f365a769605877
4
+ data.tar.gz: 9100353d834b8db13f102fa68b55cf72afc3a1f7
5
5
  SHA512:
6
- metadata.gz: 64f1e52d72c9a768bcddac7d29bb3570e4af701b9b8f809519a7c5bec8a9d36df25bad7cc9325ca5e82a7a1126ba9b45e5af72b9b8188c911072659ad9f96589
7
- data.tar.gz: ff808fd788c1e47a32fdd877f4bafb5a9812e2b650a178ec919a1745a3f6bb2b9608360cb0db33f5d203d0a9aee5508bbb10e25445e6153ebb332e4137475195
6
+ metadata.gz: 6f340402085bd3a0d030ac3c186c61f671f3d386ce0ff03069e8634fd1924a2e78cdc61072dc8b0ca968307b97fb81d0f0a1c2c896217dcddaf1072610cfbc39
7
+ data.tar.gz: 42d7071658809d123710d4ccf28ec211228b56abfcfe91560b6e9d5e452460ee53c6d0c6a51b5ac5394b5c41e059406c80a0a5726387cefd17588927eb6ce559
data/README.md CHANGED
@@ -6,6 +6,14 @@ For more information see the following:
6
6
 
7
7
  Release notes:
8
8
 
9
+ * Version 0.0.6
10
+
11
+ - Incorporate changes from jdjkelly to name fields
12
+
13
+ * Version 0.0.5
14
+
15
+ - Use HTTPS for social API
16
+
9
17
  * Version 0.0.4
10
18
 
11
19
  - Added skip_info? patch from mkdynamic
@@ -6,9 +6,9 @@ module OmniAuth
6
6
 
7
7
  # An omniauth 1.0 strategy for yahoo authentication
8
8
  class Yahoo < OmniAuth::Strategies::OAuth
9
-
9
+
10
10
  option :name, 'yahoo'
11
-
11
+
12
12
  option :client_options, {
13
13
  :access_token_path => '/oauth/v2/get_token',
14
14
  :authorize_path => '/oauth/v2/request_auth',
@@ -16,11 +16,11 @@ module OmniAuth
16
16
  :site => 'https://api.login.yahoo.com'
17
17
  }
18
18
 
19
- uid {
19
+ uid {
20
20
  access_token.params['xoauth_yahoo_guid']
21
21
  }
22
-
23
- info do
22
+
23
+ info do
24
24
  primary_email = nil
25
25
  if user_info['emails']
26
26
  email_info = user_info['emails'].find{|e| e['primary']} || user_info['emails'].first
@@ -28,7 +28,9 @@ module OmniAuth
28
28
  end
29
29
  {
30
30
  :nickname => user_info['nickname'],
31
- :name => user_info['givenName'] || user_info['nickname'],
31
+ :name => "#{user_info['givenName']} #{user_info['familyName']}" || user_info['nickname'],
32
+ :first_name => user_info['givenName'],
33
+ :last_name => user_info['familyName'],
32
34
  :image => user_info['image']['imageUrl'],
33
35
  :description => user_info['message'],
34
36
  :email => primary_email,
@@ -37,15 +39,15 @@ module OmniAuth
37
39
  }
38
40
  }
39
41
  end
40
-
42
+
41
43
  extra do
42
44
  hash = {}
43
45
  hash[:raw_info] = raw_info unless skip_info?
44
46
  hash
45
47
  end
46
48
 
47
- # Return info gathered from the v1/user/:id/profile API call
48
-
49
+ # Return info gathered from the v1/user/:id/profile API call
50
+
49
51
  def raw_info
50
52
  # This is a public API and does not need signing or authentication
51
53
  request = "https://social.yahooapis.com/v1/user/#{uid}/profile?format=json"
@@ -55,7 +57,7 @@ module OmniAuth
55
57
  end
56
58
 
57
59
  # Provide the "Profile" portion of the raw_info
58
-
60
+
59
61
  def user_info
60
62
  @user_info ||= raw_info.nil? ? {} : raw_info["profile"]
61
63
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Yahoo
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-yahoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Breitkreutz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth