omniauth-geekpark 1.0.7 → 1.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
- SHA1:
3
- metadata.gz: c435caef8d782e560689a431935243457d9f33bc
4
- data.tar.gz: 2873f67b8fc643cc0fcf0d86fcbdc8188086d2d8
2
+ SHA256:
3
+ metadata.gz: 1a2ff60a5562a3016e57b4fbed16ecc0b08eb0a83912aaccc16dd4fa7bde93c7
4
+ data.tar.gz: 0fac56d8ce9bfebf66374aa75996b05af62c3163e9c5e7182d74e19819e6b54e
5
5
  SHA512:
6
- metadata.gz: b45228c61957f6182745c74378c2c6224b183f7ddd0d449108bc40542fd483417bc91e36c2e3ae2f32a583dc06288d6ebc78a27af43f96ed85d07fae431fec84
7
- data.tar.gz: 8d80dc8df52713ac78506e4bd412b87706d76c73e87b4a9b8449744817e1b4e74a0d5d964f81587b1d180089021cab58d79c9508403c854f3f56fa04a33c5bfa
6
+ metadata.gz: f5c554964289e65ddd3e6f1586cdbec91168bc00bdcc33baa15f77b5d368773cfe7f53a42bad8303228a0075691b1df13fcb75e2abb63cab494aef9dd63dcd1f
7
+ data.tar.gz: 41dc11a4606d59aba003f83063ad33d4ae49410369106a0c8e2ee7af01940c0469c4da74fa218d675a18e20fb77aa0c6c01eaf3da1656683f99d18edf37dae66
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-geekpark (1.0.6)
4
+ omniauth-geekpark (1.0.4)
5
5
  omniauth (~> 1.0)
6
6
  omniauth-oauth2 (= 1.3.1)
7
7
 
@@ -19,7 +19,9 @@ module OmniAuth
19
19
  company: raw_info['company'],
20
20
  title: raw_info['title'],
21
21
  bio: raw_info['bio'],
22
- avatar_url: raw_info['avatar_url']
22
+ avatar_url: raw_info['avatar_url'],
23
+ email: raw_info['email'],
24
+ mobile: raw_info['mobile']
23
25
  }
24
26
  end
25
27
 
@@ -0,0 +1,29 @@
1
+ module OmniAuth
2
+ module Strategies
3
+ class Synced < OmniAuth::Strategies::OAuth2
4
+ option :client_options, {
5
+ site: 'https://www.jiqizhixin.com/',
6
+ authorize_url: '/oauth/authorize',
7
+ token_url: '/oauth/token'
8
+ }
9
+
10
+ uid { raw_info['id'] }
11
+
12
+ info do
13
+ {
14
+ nickname: raw_info['name'],
15
+ avatar_url: raw_info['avatar_url'],
16
+ email: raw_info['email'],
17
+ bio: raw_info['bio'],
18
+ pubinfo: raw_info['pubinfo']
19
+ }
20
+ end
21
+
22
+ def raw_info
23
+ @raw_info ||= access_token.get('/api/v3/user').parsed
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ OmniAuth.config.add_camelization 'synced', 'Synced'
@@ -15,14 +15,15 @@ module OmniAuth
15
15
  {
16
16
  nickname: raw_info['nickname'],
17
17
  city: raw_info['city'],
18
- avatar: raw_info['headimgurl']
18
+ avatar: raw_info['headimgurl'],
19
+ openid: access_token['openid']
19
20
  }
20
21
  end
21
22
 
22
23
  def raw_info
23
24
  @raw_info ||= begin
24
25
  response = access_token.get(
25
- '/cgi-bin/user/info',
26
+ '/sns/userinfo',
26
27
  { params: { access_token: access_token.token,
27
28
  openid: access_token['openid'],
28
29
  lang: 'zh-CN' },
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GeekPark
3
- VERSION = '1.0.7'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -6,3 +6,4 @@ require 'omniauth/strategies/geekpark'
6
6
  require 'omniauth/strategies/wechat'
7
7
  require 'omniauth/strategies/wechat_service'
8
8
  require 'omniauth/strategies/weibo'
9
+ require 'omniauth/strategies/synced'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-geekpark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HaoYunfei
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-05-31 00:00:00.000000000 Z
12
+ date: 2022-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -120,6 +120,7 @@ files:
120
120
  - lib/omniauth-geekpark/helper.rb
121
121
  - lib/omniauth-geekpark/version.rb
122
122
  - lib/omniauth/strategies/geekpark.rb
123
+ - lib/omniauth/strategies/synced.rb
123
124
  - lib/omniauth/strategies/wechat.rb
124
125
  - lib/omniauth/strategies/wechat_service.rb
125
126
  - lib/omniauth/strategies/weibo.rb
@@ -144,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
145
  - !ruby/object:Gem::Version
145
146
  version: '0'
146
147
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.5.1
148
+ rubygems_version: 3.2.2
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: OmniAuth strategies for GeekPark. Includes geekpark, weibo and wechat.