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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffb33696d1a2f483737a9fa8b0a01e7e128c5f10
4
- data.tar.gz: bb3e04e484ce61941564925cfc22a17aa851157a
3
+ metadata.gz: ce994049ebc7d12cc3311da706d0555a26441ffb
4
+ data.tar.gz: 95713e6b62ab30d76ca1f269908caedc61c01116
5
5
  SHA512:
6
- metadata.gz: fb74e2140435c17f7862de7691965bab6ed7cf486c7f5df408c11be0f233b0aea410880165b8fae9cd369eebb438cf61915682e616cc5a1312d8fb0abf7969e9
7
- data.tar.gz: 76260d3eac6214681540d5c96ef5eca265737992d6a763f17d5d27db07069f2adde2b05e5773bf81675405f7ce3e063d3c513b7b1f62ff790f8a286dc36162d3
6
+ metadata.gz: aacffa1023b35ae8e94a695ead4ed09a75c059dd03bbef68272e1dc06ace938303e6d4033694115abded0de2e348e7d0b639535faa7ff0e8f7a3774962386369
7
+ data.tar.gz: 2575916c9ffadbb9d9dfa2f33cb92135f5460a4308203e0e78777ff8963db5297cfed726e64a2988edebd6cd1dae2f674580a509bcdcd41d240df5284144f8ce
@@ -62,7 +62,7 @@ module Userbin
62
62
 
63
63
  def script_tag
64
64
  script_url = ENV.fetch('USERBIN_SCRIPT_URL') {
65
- "https://js.userbin.com"
65
+ "//js.userbin.com"
66
66
  }
67
67
  str = <<-SCRIPT_TAG
68
68
  <script src="#{script_url}?#{Userbin.config.app_id}"></script>
@@ -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.user.id)
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(user_id)
35
+ def self.refresh_session(session_id)
36
36
  api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://api.userbin.com'
37
- uri = URI("#{api_endpoint}/users/#{user_id}/sessions")
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
 
@@ -1,3 +1,3 @@
1
1
  module Userbin
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan