userbin 0.2.1 → 0.2.2
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 +7 -7
- data/lib/userbin/userbin.rb +3 -3
- data/lib/userbin/version.rb +1 -1
- data/lib/userbin.rb +1 -1
- data/spec/userbin_spec.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: a53b7ce5956e924c312988da213d450af0452dd9
|
4
|
+
data.tar.gz: f23fff56bb22109692e8a56799b3c6a432b2db74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0285983c3614f68e4072ffa316bf145ea3a3590220c8e517a649c084876b3b78212ef1b687feaac0b443af810b143d2deae74f1d388a9571fcce48b5c16b039d
|
7
|
+
data.tar.gz: ecc1820bd394efe36441919b64e3de39ebf33b9d10fce94d0581d1d0f8080b8bd619c459447ba62a0ad96d886c7aa74d48e02d900269fa2e62c92ed428ebbe8b
|
@@ -41,9 +41,9 @@ module Userbin
|
|
41
41
|
}
|
42
42
|
|
43
43
|
Rack::Utils.delete_cookie_header!(
|
44
|
-
headers, '
|
44
|
+
headers, '_ubs', value = {})
|
45
45
|
Rack::Utils.delete_cookie_header!(
|
46
|
-
headers, '
|
46
|
+
headers, '_ubd', value = {})
|
47
47
|
|
48
48
|
[ 400, headers, [message] ]
|
49
49
|
end
|
@@ -68,7 +68,7 @@ module Userbin
|
|
68
68
|
|
69
69
|
def script_tag
|
70
70
|
script_url = ENV.fetch('USERBIN_SCRIPT_URL') {
|
71
|
-
"https://userbin.com
|
71
|
+
"https://js.userbin.com"
|
72
72
|
}
|
73
73
|
str = <<-SCRIPT_TAG
|
74
74
|
<script src="#{script_url}?#{Userbin.config.app_id}"></script>
|
@@ -129,14 +129,14 @@ module Userbin
|
|
129
129
|
|
130
130
|
if signature && data
|
131
131
|
Rack::Utils.set_cookie_header!(
|
132
|
-
headers, '
|
132
|
+
headers, '_ubs', value: signature, path: '/')
|
133
133
|
Rack::Utils.set_cookie_header!(
|
134
|
-
headers, '
|
134
|
+
headers, '_ubd', value: data, path: '/')
|
135
135
|
else
|
136
136
|
Rack::Utils.delete_cookie_header!(
|
137
|
-
headers, '
|
137
|
+
headers, '_ubs', value = {})
|
138
138
|
Rack::Utils.delete_cookie_header!(
|
139
|
-
headers, '
|
139
|
+
headers, '_ubd', value = {})
|
140
140
|
end
|
141
141
|
|
142
142
|
[status, headers, response]
|
data/lib/userbin/userbin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Userbin
|
2
2
|
def self.authenticate_events!(request, now = Time.now)
|
3
3
|
signature, data =
|
4
|
-
request.params.values_at('
|
4
|
+
request.params.values_at('signature', 'data')
|
5
5
|
|
6
6
|
valid_signature?(signature, data)
|
7
7
|
|
@@ -12,7 +12,7 @@ module Userbin
|
|
12
12
|
#
|
13
13
|
def self.authenticate!(request, now = Time.now)
|
14
14
|
signature, data =
|
15
|
-
request.cookies.values_at('
|
15
|
+
request.cookies.values_at('_ubs', '_ubd')
|
16
16
|
|
17
17
|
if signature && data && valid_signature?(signature, data)
|
18
18
|
|
@@ -34,7 +34,7 @@ module Userbin
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.refresh_session(user_id)
|
37
|
-
api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://userbin.com
|
37
|
+
api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://api.userbin.com'
|
38
38
|
uri = URI("#{api_endpoint}/users/#{user_id}/sessions")
|
39
39
|
net = Net::HTTP.post_form(uri, {})
|
40
40
|
uri.user = config.app_id
|
data/lib/userbin/version.rb
CHANGED
data/lib/userbin.rb
CHANGED
data/spec/userbin_spec.rb
CHANGED