omniauth-bungie-oauth2 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b651f2022b030e894273b6b25b4611671df43ff0
4
- data.tar.gz: 581fcf757b94b5959c57f2c40a465277ef380e7e
3
+ metadata.gz: 0ae5a58332f7b9a97ebfb48b45151b06f3b98bb6
4
+ data.tar.gz: 3197c73b84b4c359af4008c481e3bd06855b2bd2
5
5
  SHA512:
6
- metadata.gz: 4382fe1d09c6d158cf099a5feb99ba0dc12d67e1722a6aaa707a433fc60e7c1d2ac4df5cbd80ea9d23deabad425521cc974f7f968184a2d8c7d7d7ef2711fd31
7
- data.tar.gz: 0d3142627717410b590c4377fe2405a7dc043d1eb551ef40c9be6bbecf8df1d482e8b618fdd9a21ab292b91477cc3b9b5302698fa1d63440acf9c9f205f6467e
6
+ metadata.gz: 1f3c44ae4d32a411e6e4f5b044afeb5ea11912ff34d0b3dec64fd9df45ac3be4fd49355de0b6d4cd2dae9809f5234f35c6a9dda2ebb0604e0812b59549ea63aa
7
+ data.tar.gz: 651dbc6e3ba8cdb4909d2f820369d1511d26a5f939ef32927bb7f88379f4150899c41ac73435d9603092951784593ddc3304b829b21a0714c774c7a2ae8e3782
data/README.md CHANGED
@@ -101,7 +101,7 @@ After all manipulation the `request.env["omniauth.auth"]` have the next fields:
101
101
 
102
102
  * `uid` with BungieNetUser membershipId
103
103
  * `info` with membershipId, uniqueName, displayName
104
- * `extra` with [GetCurrentBungieNetUser](https://destinydevs.github.io/BungieNetPlatform/docs/UserService/GetCurrentBungieNetUser) result
104
+ * `extra` with [GetMembershipDataForCurrentUser](https://destinydevs.github.io/BungieNetPlatform/docs/UserService/GetMembershipDataForCurrentUser) result
105
105
 
106
106
  ## Contributing
107
107
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module BungieOauth2
3
- VERSION = '1.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -27,14 +27,16 @@ module OmniAuth
27
27
  end
28
28
 
29
29
  uid do
30
- raw_info['membershipId']
30
+ raw_info.dig('bungieNetUser', 'membershipId')
31
31
  end
32
32
 
33
33
  info do
34
+ info = raw_info['bungieNetUser'] || {}
35
+
34
36
  {
35
- :membership_id => raw_info['membershipId'],
36
- :unique_name => raw_info['uniqueName'],
37
- :display_name => raw_info['displayName']
37
+ :membership_id => info['membershipId'],
38
+ :unique_name => info['uniqueName'],
39
+ :display_name => info['displayName']
38
40
  }
39
41
  end
40
42
 
@@ -43,7 +45,7 @@ module OmniAuth
43
45
  def raw_info
44
46
  return @raw_info unless @raw_info.nil?
45
47
 
46
- @raw_info = access_token.get('/Platform/User/GetCurrentBungieNetUser/').parsed
48
+ @raw_info = access_token.get('/Platform/User/GetMembershipsForCurrentUser/').parsed
47
49
  @raw_info = (@raw_info['ErrorCode'] == 1) ? @raw_info['Response'] : {}
48
50
  end
49
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bungie-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Ruban
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-22 00:00:00.000000000 Z
11
+ date: 2017-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler