omniauth-ekuaishou 0.1.0 → 0.2.0
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/omniauth-ekuaishou/access_token.rb +4 -4
- data/lib/omniauth-ekuaishou/version.rb +1 -1
- data/lib/omniauth/strategies/ekuaishou.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a9db35a70811ae93a5621785285aaf0721b96fde9a935692d406f5cfcd42a4a
|
4
|
+
data.tar.gz: 9399a320f12dc4483caf686973c86a285e4024b5c143cae9d720a8f0083c46cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250c609fe82b04dab58190e5e129d234ab141bc844e3990260213b5d97cd2c8ec853284b8503cfd5866ef16474093ff6c5eaad26c2a682b7cd859f87b0bf32da
|
7
|
+
data.tar.gz: d2a42c587f145e46be77a6489425570680aa1f4449275072201b97532bcf07cbbd498d628d98766aad3b2feb2a24b5e502aab72a5bcdb7a8f9df5e0516620b67
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -4,10 +4,10 @@ module OmniAuth
|
|
4
4
|
class << self
|
5
5
|
def from_hash(client, hash)
|
6
6
|
return unless hash && hash['code'] == 0 && hash.dig('data', 'access_token').present?
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
)
|
7
|
+
|
8
|
+
data = hash['data'].merge('expires_in' => hash.dig('data', 'access_token_expires_in'))
|
9
|
+
data['refresh_token_expires_at'] ||= Time.now.to_i + data['refresh_token_expires_in'].to_i if data['refresh_token_expires_in'].present?
|
10
|
+
super(client, data)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -46,11 +46,19 @@ module OmniAuth
|
|
46
46
|
))
|
47
47
|
end
|
48
48
|
|
49
|
+
credentials do
|
50
|
+
hash = {"token" => access_token.token}
|
51
|
+
hash["refresh_token"] = access_token.refresh_token if access_token.expires? && access_token.refresh_token
|
52
|
+
hash["expires_at"] = access_token.expires_at if access_token.expires?
|
53
|
+
hash["expires"] = access_token.expires?
|
54
|
+
hash["refresh_token_expires_at"] = access_token['refresh_token_expires_at'] if access_token['refresh_token_expires_at'].present?
|
55
|
+
hash
|
56
|
+
end
|
57
|
+
|
49
58
|
extra do
|
50
59
|
{
|
51
60
|
scope: scope,
|
52
|
-
raw_info: raw_info
|
53
|
-
refresh_token_expires_in: access_token['refresh_token_expires_in']
|
61
|
+
raw_info: raw_info
|
54
62
|
}
|
55
63
|
end
|
56
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-ekuaishou
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jimcheung
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|