omniauth-ljne 0.1.0 → 0.1.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: c3b46a84169830754b426074a20a3574a2251670
4
- data.tar.gz: 82407374d82b5ce225849efe18bec5f656f49edf
3
+ metadata.gz: c545941dcb72451808be21841874a34c719d1091
4
+ data.tar.gz: bcba718fef51fc95d5063baaea707f63a136364d
5
5
  SHA512:
6
- metadata.gz: 0cf244448eb526a083bd138cf3fe85257f56a8e02b5a38f1e4d4c341261b133d45798862e50055f4b95510fed5f9cce627978d2770f27aa8ee026e7b5de3d233
7
- data.tar.gz: 129dba5603c7b089a666fb865c48c01d6f4481ac0873fd13149cdb6af6728a330d669b3ce3e8825d2a59c82a590774848a7465b951e7f6d85fb6160175e67f83
6
+ metadata.gz: e0e0da965be8e8794279157f14397557a521425fa5e2cc64e47db63dc1f09194b29bdeef53d72684ecea6c61e511888f06ddeae507cd188d6f427881380fe7c5
7
+ data.tar.gz: 7c123418047288bf197b2c7b23c34ad356d529a47bd6664402321bd4957645918cbba62dd92671738eb9523fd5df67cdbaa2012ef4d90560583de3717d06ad9f
data/Gemfile.lock ADDED
@@ -0,0 +1,153 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-ljne (0.1.0)
5
+ omniauth-oauth2 (~> 1.3.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.2.3)
11
+ actionpack (= 5.2.3)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.3)
15
+ actionpack (= 5.2.3)
16
+ actionview (= 5.2.3)
17
+ activejob (= 5.2.3)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.2.3)
21
+ actionview (= 5.2.3)
22
+ activesupport (= 5.2.3)
23
+ rack (~> 2.0)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.2.3)
28
+ activesupport (= 5.2.3)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.3)
34
+ activesupport (= 5.2.3)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.2.3)
37
+ activesupport (= 5.2.3)
38
+ activerecord (5.2.3)
39
+ activemodel (= 5.2.3)
40
+ activesupport (= 5.2.3)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.3)
43
+ actionpack (= 5.2.3)
44
+ activerecord (= 5.2.3)
45
+ marcel (~> 0.3.1)
46
+ activesupport (5.2.3)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (>= 0.7, < 2)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ arel (9.0.0)
52
+ bindex (0.8.1)
53
+ builder (3.2.3)
54
+ concurrent-ruby (1.1.5)
55
+ crass (1.0.4)
56
+ erubi (1.8.0)
57
+ faraday (0.15.4)
58
+ multipart-post (>= 1.2, < 3)
59
+ globalid (0.4.2)
60
+ activesupport (>= 4.2.0)
61
+ hashie (3.6.0)
62
+ i18n (1.6.0)
63
+ concurrent-ruby (~> 1.0)
64
+ jwt (2.2.1)
65
+ loofah (2.2.3)
66
+ crass (~> 1.0.2)
67
+ nokogiri (>= 1.5.9)
68
+ mail (2.7.1)
69
+ mini_mime (>= 0.1.1)
70
+ marcel (0.3.3)
71
+ mimemagic (~> 0.3.2)
72
+ method_source (0.9.2)
73
+ mimemagic (0.3.3)
74
+ mini_mime (1.0.2)
75
+ mini_portile2 (2.4.0)
76
+ minitest (5.11.3)
77
+ multi_json (1.13.1)
78
+ multi_xml (0.6.0)
79
+ multipart-post (2.1.1)
80
+ nio4r (2.5.1)
81
+ nokogiri (1.10.4)
82
+ mini_portile2 (~> 2.4.0)
83
+ oauth2 (1.4.1)
84
+ faraday (>= 0.8, < 0.16.0)
85
+ jwt (>= 1.0, < 3.0)
86
+ multi_json (~> 1.3)
87
+ multi_xml (~> 0.5)
88
+ rack (>= 1.2, < 3)
89
+ omniauth (1.9.0)
90
+ hashie (>= 3.4.6, < 3.7.0)
91
+ rack (>= 1.6.2, < 3)
92
+ omniauth-oauth2 (1.3.1)
93
+ oauth2 (~> 1.0)
94
+ omniauth (~> 1.2)
95
+ rack (2.0.7)
96
+ rack-test (1.1.0)
97
+ rack (>= 1.0, < 3)
98
+ rails (5.2.3)
99
+ actioncable (= 5.2.3)
100
+ actionmailer (= 5.2.3)
101
+ actionpack (= 5.2.3)
102
+ actionview (= 5.2.3)
103
+ activejob (= 5.2.3)
104
+ activemodel (= 5.2.3)
105
+ activerecord (= 5.2.3)
106
+ activestorage (= 5.2.3)
107
+ activesupport (= 5.2.3)
108
+ bundler (>= 1.3.0)
109
+ railties (= 5.2.3)
110
+ sprockets-rails (>= 2.0.0)
111
+ rails-dom-testing (2.0.3)
112
+ activesupport (>= 4.2.0)
113
+ nokogiri (>= 1.6)
114
+ rails-html-sanitizer (1.2.0)
115
+ loofah (~> 2.2, >= 2.2.2)
116
+ railties (5.2.3)
117
+ actionpack (= 5.2.3)
118
+ activesupport (= 5.2.3)
119
+ method_source
120
+ rake (>= 0.8.7)
121
+ thor (>= 0.19.0, < 2.0)
122
+ rake (12.3.3)
123
+ sprockets (3.7.2)
124
+ concurrent-ruby (~> 1.0)
125
+ rack (> 1, < 3)
126
+ sprockets-rails (3.2.1)
127
+ actionpack (>= 4.0)
128
+ activesupport (>= 4.0)
129
+ sprockets (>= 3.0.0)
130
+ thor (0.20.3)
131
+ thread_safe (0.3.6)
132
+ tzinfo (1.2.5)
133
+ thread_safe (~> 0.1)
134
+ web-console (3.7.0)
135
+ actionview (>= 5.0)
136
+ activemodel (>= 5.0)
137
+ bindex (>= 0.4.0)
138
+ railties (>= 5.0)
139
+ websocket-driver (0.7.1)
140
+ websocket-extensions (>= 0.1.0)
141
+ websocket-extensions (0.1.4)
142
+
143
+ PLATFORMS
144
+ ruby
145
+
146
+ DEPENDENCIES
147
+ bundler (~> 1.17)
148
+ omniauth-ljne!
149
+ rails (~> 5.2)
150
+ web-console (~> 3.3, >= 3.3.0)
151
+
152
+ BUNDLED WITH
153
+ 1.17.3
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Ljne
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -0,0 +1,58 @@
1
+ require 'omniauth-oauth2'
2
+ require 'json'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Line < OmniAuth::Strategies::OAuth2
7
+ option :name, 'line'
8
+ option :scope, 'profile openid'
9
+
10
+ option :client_options, {
11
+ site: 'https://access.line.me',
12
+ authorize_url: '/oauth2/v2.1/authorize',
13
+ token_url: '/oauth2/v2.1/token'
14
+ }
15
+
16
+ def callback_phase
17
+ options[:client_options][:site] = 'https://api.line.me'
18
+ super
19
+ end
20
+
21
+ alias :old_callback_url :callback_url
22
+
23
+ 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
39
+ end
40
+
41
+ uid { raw_info['userId'] }
42
+
43
+ info do
44
+ {
45
+ name: raw_info['displayName'],
46
+ image: raw_info['pictureUrl'],
47
+ description: raw_info['statusMessage']
48
+ }
49
+ end
50
+
51
+ def raw_info
52
+ @raw_info ||= JSON.load(access_token.get('v2/profile').body)
53
+ rescue ::Errno::ETIMEDOUT
54
+ raise ::Timeout::Error
55
+ end
56
+ end
57
+ end
58
+ end
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nguyenthanhcong101096
@@ -68,6 +68,7 @@ files:
68
68
  - ".gitignore"
69
69
  - CODE_OF_CONDUCT.md
70
70
  - Gemfile
71
+ - Gemfile.lock
71
72
  - LICENSE.txt
72
73
  - README.md
73
74
  - Rakefile
@@ -75,6 +76,8 @@ files:
75
76
  - bin/setup
76
77
  - lib/omniauth/ljne.rb
77
78
  - lib/omniauth/ljne/version.rb
79
+ - lib/omniauth/strategies/line.rb
80
+ - omniauth-ljne-0.1.0.gem
78
81
  - omniauth-ljne.gemspec
79
82
  homepage: https://github.com/nguyenthanhcong101096/omniauth-line
80
83
  licenses: