userbin 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/userbin/authentication.rb +1 -1
- data/lib/userbin/userbin.rb +4 -4
- data/lib/userbin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce994049ebc7d12cc3311da706d0555a26441ffb
|
4
|
+
data.tar.gz: 95713e6b62ab30d76ca1f269908caedc61c01116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aacffa1023b35ae8e94a695ead4ed09a75c059dd03bbef68272e1dc06ace938303e6d4033694115abded0de2e348e7d0b639535faa7ff0e8f7a3774962386369
|
7
|
+
data.tar.gz: 2575916c9ffadbb9d9dfa2f33cb92135f5460a4308203e0e78777ff8963db5297cfed726e64a2988edebd6cd1dae2f674580a509bcdcd41d240df5284144f8ce
|
data/lib/userbin/userbin.rb
CHANGED
@@ -20,7 +20,7 @@ module Userbin
|
|
20
20
|
|
21
21
|
if current.authenticated?
|
22
22
|
if now > Time.at(current.expires_at / 1000)
|
23
|
-
signature, data = refresh_session(current.
|
23
|
+
signature, data = refresh_session(current.id)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -32,12 +32,12 @@ module Userbin
|
|
32
32
|
[signature, data]
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.refresh_session(
|
35
|
+
def self.refresh_session(session_id)
|
36
36
|
api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://api.userbin.com'
|
37
|
-
uri = URI("#{api_endpoint}/
|
38
|
-
net = Net::HTTP.post_form(uri, {})
|
37
|
+
uri = URI("#{api_endpoint}/sessions/#{session_id}/refresh")
|
39
38
|
uri.user = config.app_id
|
40
39
|
uri.password = config.api_secret
|
40
|
+
net = Net::HTTP.post_form(uri, {})
|
41
41
|
[net['X-Userbin-Signature'], net.body]
|
42
42
|
end
|
43
43
|
|
data/lib/userbin/version.rb
CHANGED