userbin 0.2.2 → 0.2.3
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 +0 -7
- data/lib/userbin/configuration.rb +1 -1
- data/lib/userbin/events.rb +0 -4
- data/lib/userbin/rails/auth_helpers.rb +6 -10
- data/lib/userbin/session.rb +1 -6
- data/lib/userbin/userbin.rb +0 -1
- data/lib/userbin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffb33696d1a2f483737a9fa8b0a01e7e128c5f10
|
4
|
+
data.tar.gz: bb3e04e484ce61941564925cfc22a17aa851157a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb74e2140435c17f7862de7691965bab6ed7cf486c7f5df408c11be0f233b0aea410880165b8fae9cd369eebb438cf61915682e616cc5a1312d8fb0abf7969e9
|
7
|
+
data.tar.gz: 76260d3eac6214681540d5c96ef5eca265737992d6a763f17d5d27db07069f2adde2b05e5773bf81675405f7ce3e063d3c513b7b1f62ff790f8a286dc36162d3
|
@@ -60,12 +60,6 @@ module Userbin
|
|
60
60
|
LINK_TAGS
|
61
61
|
end
|
62
62
|
|
63
|
-
def meta_tag
|
64
|
-
<<-META_TAG
|
65
|
-
<meta property="userbin:events" content="/userbin" />
|
66
|
-
META_TAG
|
67
|
-
end
|
68
|
-
|
69
63
|
def script_tag
|
70
64
|
script_url = ENV.fetch('USERBIN_SCRIPT_URL') {
|
71
65
|
"https://js.userbin.com"
|
@@ -97,7 +91,6 @@ module Userbin
|
|
97
91
|
def inject_tags(body, login_path = restrict)
|
98
92
|
if body[CLOSING_HEAD_TAG]
|
99
93
|
body = body.gsub(CLOSING_HEAD_TAG, link_tags(login_path) + '\\0')
|
100
|
-
body = body.gsub(CLOSING_HEAD_TAG, meta_tag + '\\0')
|
101
94
|
end
|
102
95
|
if body[CLOSING_BODY_TAG]
|
103
96
|
body = body.gsub(CLOSING_BODY_TAG, script_tag + '\\0')
|
data/lib/userbin/events.rb
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
module Userbin
|
2
2
|
module AuthHelpers
|
3
|
-
def
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
else
|
10
|
-
User
|
11
|
-
end
|
12
|
-
@current_user ||= user_klass.find(local_id)
|
3
|
+
def current_user
|
4
|
+
return unless Userbin.authenticated?
|
5
|
+
if Userbin.config.current_user
|
6
|
+
@current_user ||= Userbin.config.current_user.call(Userbin.current_user)
|
7
|
+
else
|
8
|
+
raise "Userbin: No method configured for returning 'current_user'"
|
13
9
|
end
|
14
10
|
end
|
15
11
|
end
|
data/lib/userbin/session.rb
CHANGED
data/lib/userbin/userbin.rb
CHANGED
@@ -19,7 +19,6 @@ module Userbin
|
|
19
19
|
current = Userbin::Session.new(MultiJson.decode(data))
|
20
20
|
|
21
21
|
if current.authenticated?
|
22
|
-
# FIXME: NoMethodError (undefined method `/' for nil:NilClass):
|
23
22
|
if now > Time.at(current.expires_at / 1000)
|
24
23
|
signature, data = refresh_session(current.user.id)
|
25
24
|
end
|
data/lib/userbin/version.rb
CHANGED
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.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description: Plug n
|
83
|
+
description: Plug n' play user accounts. The simplest way to integrate a full authentication
|
84
84
|
and user management stack into your web application.
|
85
85
|
email: johan@userbin.com
|
86
86
|
executables: []
|