omniauth-ljne 0.1.5 → 0.1.6

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: 28f37cba21e3a7d9a0d8680ad2c2953b32dbaa59
4
- data.tar.gz: b519a8b6f8e36e4330c4b8ca402a3923fdf1a0d9
3
+ metadata.gz: 83125df60d556f7a40acf17b2aea81de69105cb5
4
+ data.tar.gz: 5dc4439d41fbb938b67e62795ab9ad6ded59dcfc
5
5
  SHA512:
6
- metadata.gz: 91c50414e892c83a7ee11256df7ec4c5787c48edc4e0767c8468638cbf1d9532687d82fe442fa326f79f795f6b663f6c62bb880c7e28d02f21d5c0d44b741361
7
- data.tar.gz: cd45028805862bb27bc4126e5a463806ad2c973fd1203befdb4d7ef66fada21e5e73794bd2b949f9cf9acdcc0bef3924f6311b8c14741fb3f792d50eeb800735
6
+ metadata.gz: fc9ead18654fa94723be237741c60b60ea6d7562e77780dcbad9647b015081698003b48757b1091e335f6b26dc1c502003d8e93ee585860e8ddc2823eacc1bbf
7
+ data.tar.gz: f931f69c7001e204bb336eb0cad58c422f424e759699551d3629f8af1d00ec1eab73eb0af6350050bdf4532f15fe7d467173bbf4fbdbd8a5f61b271542be9b8c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-ljne (0.1.1)
4
+ omniauth-ljne (0.1.5)
5
5
  omniauth-oauth2 (~> 1.3.1)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Ljne
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ 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',
@@ -19,7 +19,7 @@ module OmniAuth
19
19
  end
20
20
 
21
21
  alias :old_callback_url :callback_url
22
-
22
+
23
23
  def callback_url
24
24
  if request.params['callback_url']
25
25
  request.params['callback_url']
@@ -37,19 +37,26 @@ module OmniAuth
37
37
  URI(params['callback_url']).path
38
38
  end
39
39
  end
40
-
40
+
41
41
  uid { raw_info['userId'] }
42
42
 
43
43
  info do
44
44
  {
45
45
  name: raw_info['displayName'],
46
- email: raw_info['email'],
47
- image: raw_info['pictureUrl'],
48
- description: raw_info['statusMessage'],
49
- info: raw_info
46
+ email: extra["email"],
47
+ image: raw_info['pictureUrl']
50
48
  }
51
49
  end
52
50
 
51
+ extra do
52
+ hash = {}
53
+ hash[:id_token] = access_token['id_token']
54
+ if !options[:skip_jwt] && !access_token['id_token'].nil?
55
+ decoded = ::JWT.decode(access_token['id_token'], nil, false).first
56
+ hash[:id_info] = decoded
57
+ end
58
+ end
59
+
53
60
  def raw_info
54
61
  @raw_info ||= JSON.load(access_token.get('v2/profile').body)
55
62
  rescue ::Errno::ETIMEDOUT
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-ljne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - nguyenthanhcong101096
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,6 +82,7 @@ files:
82
82
  - omniauth-ljne-0.1.2.gem
83
83
  - omniauth-ljne-0.1.3.gem
84
84
  - omniauth-ljne-0.1.4.gem
85
+ - omniauth-ljne-0.1.5.gem
85
86
  - omniauth-ljne.gemspec
86
87
  homepage: https://github.com/nguyenthanhcong101096/omniauth-line
87
88
  licenses: