omniauth-ljne 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 9e1de255692528a9a5135cf4423c40133c08815f9926c3a8026818bab5d6acf5
4
- data.tar.gz: 6169e4bc6fa5ea7736862c889dec19199aba5250ac06657589f9f659494d7a35
3
+ metadata.gz: dd5defe753153e553bd9671b77171712b58839e1acc57367f3fb486dd315dffa
4
+ data.tar.gz: 4c54d275c163fd95420f192e97d1f36510ae32552707ee55e8ee95985c4d1740
5
5
  SHA512:
6
- metadata.gz: cfda30070756fe298fee55f6d83c8a0735d11706f4f9724ad598b1c509731cd5cc4c1bad49d20842f442987f38200f8656c37d8be51b334cfa6fe95c59c79b95
7
- data.tar.gz: cbd75e367bed0234ebca534fc7ae348f405f557b8bf6f1eeb01651d9f90bc8148c2fd1f083de71ba17105e3c7bb45b52719e35330de713e429efb338ec8606e5
6
+ metadata.gz: 73a5c694a93118f86db20e73063e53689104e7265d96c984691d35d6ed61dec7cdffd8a44501d605b1630dc8b03fecab0d5e3a3b8bc0552769c019b2e495ab30
7
+ data.tar.gz: a86a3b73de4ba82f9b61a6c36377880f9faba67c7701aff5b96e32dcfc0090a203817ca26822e26d3ef640a76ffa5a9ff6db1a74337117134ff9b7f8d7d29b85
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-ljne (0.1.7)
4
+ omniauth-ljne (0.1.8)
5
5
  omniauth-oauth2 (~> 1.6)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Ljne
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
@@ -6,36 +6,21 @@ module OmniAuth
6
6
  class Line < OmniAuth::Strategies::OAuth2
7
7
  option :name, 'line'
8
8
  option :scope, 'profile openid email'
9
-
9
+
10
10
  option :client_options, {
11
11
  site: 'https://access.line.me',
12
12
  authorize_url: '/oauth2/v2.1/authorize',
13
13
  token_url: '/oauth2/v2.1/token'
14
14
  }
15
15
 
16
+ # host changed
16
17
  def callback_phase
17
18
  options[:client_options][:site] = 'https://api.line.me'
18
19
  super
19
20
  end
20
21
 
21
- alias :old_callback_url :callback_url
22
-
23
22
  def callback_url
24
- if request.params['callback_url']
25
- request.params['callback_url']
26
- else
27
- old_callback_url
28
- end
29
- end
30
-
31
- def callback_path
32
- params = session['omniauth.params']
33
-
34
- if params.nil? || params['callback_url'].nil?
35
- super
36
- else
37
- URI(params['callback_url']).path
38
- end
23
+ options[:redirect_uri] || (full_host + script_name + callback_path)
39
24
  end
40
25
 
41
26
  uid { raw_info['userId'] }
@@ -43,8 +28,8 @@ module OmniAuth
43
28
  info do
44
29
  {
45
30
  name: raw_info['displayName'],
46
- email: extra["email"],
47
- image: raw_info['pictureUrl']
31
+ image: raw_info['pictureUrl'],
32
+ email: extra['email']
48
33
  }
49
34
  end
50
35
 
@@ -57,6 +42,7 @@ module OmniAuth
57
42
  end
58
43
  end
59
44
 
45
+ # Require: Access token with PROFILE permission issued.
60
46
  def raw_info
61
47
  @raw_info ||= JSON.load(access_token.get('v2/profile').body)
62
48
  rescue ::Errno::ETIMEDOUT
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-ljne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - nguyenthanhcong101096
@@ -84,6 +84,7 @@ files:
84
84
  - omniauth-ljne-0.1.4.gem
85
85
  - omniauth-ljne-0.1.5.gem
86
86
  - omniauth-ljne-0.1.6.gem
87
+ - omniauth-ljne-0.1.7.gem
87
88
  - omniauth-ljne.gemspec
88
89
  homepage: https://github.com/nguyenthanhcong101096/omniauth-line
89
90
  licenses: