omniauth-zalo 0.1.1 → 0.1.2

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: c9597ef9fb031db0697ed60c4ab91b9c73a706f0
4
- data.tar.gz: e354c3cc3c81604ae2fe4ce3ae9be6a583697faa
3
+ metadata.gz: 30740d3b00ef67d9af52350a8ae7523b1f5a5431
4
+ data.tar.gz: 66443d4bc30f181a326472f72c19d4ff714f883f
5
5
  SHA512:
6
- metadata.gz: d47479551ae281abfd50697a4ec2cbaf9006556587dffc853e511ebbdac66ea2f6e16552beb22d209bc99a1c68384860a2d006cd2459f476d73d058a9a2e1e2e
7
- data.tar.gz: 1292171028e784b1528dc4f9f76588d453e243e6ab372355a1882f4216f000f35df5b5965c2a430ffde876c6d431b3806cc70e0a4ca464dabfb39de69e26ea01
6
+ metadata.gz: 1200ff766fcf66f85d0c6aefcce9b6dda5632757a929493a699cd8bef99ee7addfbb8bc11b3b6613e83f1f08c8b930e9c0132aa26f90b0ee5325a64cc5b9d348
7
+ data.tar.gz: 0c19e9ce61ba54472f224e74b20372859d8c507729bf210ee799a97f4eab754aaad4dcaf3f651ee3575fa3a852021da117e9d330ae60603af65e2f229d01a761
@@ -5,21 +5,30 @@ module OmniAuth
5
5
  module Strategies
6
6
  class Zalo < OmniAuth::Strategies::OAuth2
7
7
  option :name, 'zalo'
8
- option :fields, 'id,birthday,name,gender,picture'
9
8
 
10
9
  option :client_options, {
11
10
  site: 'https://oauth.zaloapp.com',
12
- authorize_url: 'v3/auth',
13
- token_url: '/v3/access_token'
11
+ authorize_url: '/v3/auth',
12
+ token_url: '/v3/access_token',
13
+ token_method: :get
14
14
  }
15
15
 
16
- def callback_phase
17
- options[:client_options][:site] = 'https://graph.zalo.me/v2.0/me'
18
- super
16
+ uid { raw_info['userId'] }
17
+
18
+ info do
19
+ {
20
+ name: raw_info['displayName'],
21
+ image: raw_info['pictureUrl'],
22
+ description: raw_info['statusMessage']
23
+ }
24
+ end
25
+
26
+ def authorize_params
27
+ super.merge(app_id: self.options.client_id)
19
28
  end
20
29
 
21
30
  alias :old_callback_url :callback_url
22
-
31
+
23
32
  def callback_url
24
33
  if request.params['callback_url']
25
34
  request.params['callback_url']
@@ -37,21 +46,9 @@ module OmniAuth
37
46
  URI(params['callback_url']).path
38
47
  end
39
48
  end
40
-
41
- uid { raw_info['userId'] }
42
-
43
- info do
44
- {
45
- name: raw_info['displayName'],
46
- email: raw_info['email'],
47
- image: raw_info['pictureUrl'],
48
- description: raw_info['statusMessage'],
49
- info: raw_info
50
- }
51
- end
52
49
 
53
50
  def raw_info
54
- @raw_info ||= JSON.load(access_token.get('v2/profile').body)
51
+ @raw_info ||= JSON.load(access_token.get('https://graph.zalo.me/v2.0/me').body)
55
52
  rescue ::Errno::ETIMEDOUT
56
53
  raise ::Timeout::Error
57
54
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Zalo
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-zalo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nguyenthanhcong101096
@@ -79,6 +79,7 @@ files:
79
79
  - lib/omniauth/zalo/oauth.rb
80
80
  - lib/omniauth/zalo/version.rb
81
81
  - omniauth-zalo-0.1.0.gem
82
+ - omniauth-zalo-0.1.1.gem
82
83
  - omniauth-zalo.gemspec
83
84
  homepage: https://github.com/nguyenthanhcong101096/omniauth-zalo
84
85
  licenses: