userbin 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/userbin/authentication.rb +2 -2
- data/lib/userbin/configuration.rb +2 -2
- data/lib/userbin/version.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: 703e1f90038da45bdc11c03d1c2059587daf0cdd
|
4
|
+
data.tar.gz: 3d25c062d7f285e2c1bbb00e1ad441268b336aaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3528a4705cd2c6f3f530d6e2351c5f703ba8f28be9303017a30d6fa0d745c69c335434ae3737a86bf14cfc891b849834aebbca3e469e6e83c789cd1b2c08147
|
7
|
+
data.tar.gz: 4d0e84b2dbbe75a9662f168c854669d7a496ae8eea9ea24461fc79eebad21ea885a7d1428a09d05a3f8b9a2ca9a680d8edbeeabbd6d58c7da484e207360e7d87
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/userbin/userbin-ruby.png)](https://travis-ci.org/userbin/userbin-ruby)
|
2
|
+
|
1
3
|
Userbin for Ruby
|
2
4
|
================
|
3
5
|
|
@@ -132,12 +134,12 @@ You'll need to migrate your users and add a reference to the Userbin profile:
|
|
132
134
|
rails g migration AddUserbinIdToUsers userbin_id:integer:index
|
133
135
|
```
|
134
136
|
|
135
|
-
###
|
137
|
+
### skip_script_injection
|
136
138
|
|
137
|
-
By default, the Userbin middleware will automatically insert a `<script>` tag before the closing `</body>` in your HTML files in order to handle forms, sessions and user tracking. This script loads everything asynchronously, so it won't affect your page load speed. However if you want to have control of this procedure, set `
|
139
|
+
By default, the Userbin middleware will automatically insert a `<script>` tag before the closing `</body>` in your HTML files in order to handle forms, sessions and user tracking. This script loads everything asynchronously, so it won't affect your page load speed. However if you want to have control of this procedure, set `skip_script_injection` to true and initialize the library yourself. To do that, checkout the [Userbin.js configuration guide](https://userbin.com/docs/javascript#configuration).
|
138
140
|
|
139
141
|
```ruby
|
140
|
-
config.
|
142
|
+
config.skip_script_injection = true
|
141
143
|
```
|
142
144
|
|
143
145
|
|
@@ -104,7 +104,7 @@ module Userbin
|
|
104
104
|
else
|
105
105
|
body = response
|
106
106
|
end
|
107
|
-
if Userbin.config.
|
107
|
+
if !Userbin.config.skip_script_injection
|
108
108
|
body = body.each.map do |chunk|
|
109
109
|
inject_tags(chunk)
|
110
110
|
end
|
@@ -115,7 +115,7 @@ module Userbin
|
|
115
115
|
response = body
|
116
116
|
end
|
117
117
|
unless body.empty?
|
118
|
-
headers['Content-Length'] = body.flatten[0].
|
118
|
+
headers['Content-Length'] = Rack::Utils.bytesize(body.flatten[0]).to_s
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
@@ -2,7 +2,7 @@ module Userbin
|
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :app_id
|
4
4
|
attr_accessor :api_secret
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :skip_script_injection
|
6
6
|
attr_accessor :create_user
|
7
7
|
attr_accessor :find_user
|
8
8
|
attr_accessor :protected_path
|
@@ -16,7 +16,7 @@ module Userbin
|
|
16
16
|
self.app_id = ENV["USERBIN_APP_ID"]
|
17
17
|
self.api_secret = ENV["USERBIN_API_SECRET"]
|
18
18
|
|
19
|
-
self.
|
19
|
+
self.skip_script_injection = false
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/userbin/version.rb
CHANGED
data/spec/userbin_spec.rb
CHANGED