omniauth-twitch 0.2.0 → 0.3.0

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: c6b35e14f39c1812e034b5b6d1594466365105d8
4
- data.tar.gz: bcffeb8465aa84ae179e28fde8d21d2d7cd17ed4
3
+ metadata.gz: ac4cf3351e0ff9c0c19ae13e5e3410c7206a7fd7
4
+ data.tar.gz: 5db50c2fa3186624c73c054af88331ce8073d0d5
5
5
  SHA512:
6
- metadata.gz: 25ff8352e0de7328c82cbc479db44bd248395be766299eae5249760192a019da12766a89402b69e77e02d22297bebd99e1443f07bbf9fb6e704cdbc38c6a4115
7
- data.tar.gz: 10ac5ae232b3f56539266fca117cd85fb01f1377381b2479c9ea1470a184aca2b975f67bc1d99fdd0214007716a7586d2048bd4c3f031c354d96bea521e8fe79
6
+ metadata.gz: f08515384b3aa3a12e446cde57f894735e10b6c4c8800f0749619842d42b5139452c7225d95ab3465aafc2be71f8e37af1aa96420b266add7bbce1c3f1f5eeda
7
+ data.tar.gz: bed50fd5e039e1cbfde7dbaa43b7dc392b5d63ba5337975fb183d0d324bb7726047f617447126e76b8049e3c32bfd0b1466d989716ac9e249c64cdf95fe758c7
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # OmniAuth::Twitch
4
4
 
5
- A OmniAuth strategy for Twitch
5
+ A OmniAuth strategy for Twitch recently updated to helix api
6
6
 
7
7
  ## Installation
8
8
 
data/Rakefile CHANGED
File without changes
File without changes
@@ -3,33 +3,43 @@ require 'omniauth-oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Twitch < OmniAuth::Strategies::OAuth2
6
- DEFAULT_SCOPE = 'user_read'
6
+ DEFAULT_SCOPE = "user:read:email".freeze
7
7
 
8
8
  option :name, "twitch"
9
9
 
10
10
  option :client_options, {
11
- site: 'https://api.twitch.tv',
12
- authorize_url: "/kraken/oauth2/authorize",
13
- token_url: '/kraken/oauth2/token'
11
+ site: "https://id.twitch.tv",
12
+ authorize_url: "/oauth2/authorize",
13
+ token_url: "/oauth2/token"
14
14
  }
15
15
 
16
16
  option :access_token_options, {
17
- header_format: 'OAuth %s',
18
- param_name: 'access_token'
17
+ header_format: "Bearer %s",
18
+ param_name: "access_token"
19
19
  }
20
20
 
21
21
  option :authorize_options, [:scope]
22
22
 
23
- uid{ raw_info['_id'] }
23
+ credentials do
24
+ hash = { "token" => access_token.token }
25
+ if access_token.refresh_token
26
+ hash["refresh_token"] = access_token.refresh_token
27
+ end
28
+ hash["expires_at"] = access_token.expires_at if access_token.expires?
29
+ hash["expires"] = access_token.expires?
30
+ hash
31
+ end
32
+
33
+ uid { raw_info["id"] }
24
34
 
25
35
  info do
26
36
  {
27
- name: raw_info['display_name'],
28
- email: raw_info['email'],
29
- nickname: raw_info['name'],
30
- description: raw_info['bio'],
31
- image: raw_info['logo'],
32
- urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
37
+ name: raw_info["display_name"],
38
+ email: raw_info["email"],
39
+ nickname: raw_info["login"],
40
+ description: raw_info["description"],
41
+ image: raw_info["profile_image_url"],
42
+ urls: { Twitch: "http://www.twitch.tv/#{raw_info['login']}" }
33
43
  }
34
44
  end
35
45
 
@@ -40,7 +50,9 @@ module OmniAuth
40
50
  end
41
51
 
42
52
  def raw_info
43
- @raw_info ||= access_token.get('/kraken/user.json').parsed
53
+ @raw_info ||=
54
+ access_token.get("https://api.twitch.tv/helix/users").parsed.
55
+ fetch("data").fetch(0)
44
56
  end
45
57
 
46
58
  def build_access_token
File without changes
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Twitch
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-twitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gertig (Webtheory) and William Holt (Webtheory)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-07 00:00:00.000000000 Z
11
+ date: 2018-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.4.5
92
+ rubygems_version: 2.6.14
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Twitch OAuth2 Strategy for OmniAuth