uber_login 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uber_login.rb +10 -12
- data/lib/uber_login/configuration.rb +4 -0
- data/lib/uber_login/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd28ac1eabc33e9d7211cb026c90484b8056934e
|
4
|
+
data.tar.gz: c7c3e55671bf44d93b3c07a7810062770e0c3c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94711009c3650eb6c13abad1d05f853097f7e4b298678655cfabcd67f128774356907d5b15f26283dbd801e5b34632f5c757bfbfbbabda81b0d65447faef38b
|
7
|
+
data.tar.gz: fc8854d30b37a9e56b1e92af29b3f92046c9eebdc05bd4da6c71aebe4b1d11ce630a8ee8634ae514c5466a652587d3d26aedff8d89eafb274371f90d6279908d
|
data/lib/uber_login.rb
CHANGED
@@ -64,19 +64,17 @@ module UberLogin
|
|
64
64
|
# and corresponding token removed from the database.
|
65
65
|
# If sequence is not nil it only removes the sequence and token from the database.
|
66
66
|
def logout(sequence = nil)
|
67
|
-
|
68
|
-
|
69
|
-
if
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
delete_from_database(sequence)
|
75
|
-
end
|
67
|
+
run_callbacks :logout do
|
68
|
+
if sequence.nil? or sequence == current_sequence
|
69
|
+
delete_from_database if cookies[:uid] or strong_sessions
|
70
|
+
session_manager.clear
|
71
|
+
cookie_manager.clear
|
72
|
+
else
|
73
|
+
delete_from_database(sequence)
|
76
74
|
end
|
77
|
-
|
78
|
-
@current_user = nil
|
79
75
|
end
|
76
|
+
|
77
|
+
@current_user = nil
|
80
78
|
end
|
81
79
|
|
82
80
|
##
|
@@ -113,7 +111,7 @@ module UberLogin
|
|
113
111
|
login_from_cookies if cookie_manager.login_cookies?
|
114
112
|
end
|
115
113
|
|
116
|
-
|
114
|
+
UberLogin.configuration.user_class.constantize.find(session[:uid]) rescue nil
|
117
115
|
end
|
118
116
|
|
119
117
|
##
|
@@ -28,11 +28,15 @@ module UberLogin
|
|
28
28
|
# each page load. Be sure to index :uid and :sequence together on the +login_tokens+ table.
|
29
29
|
attr_accessor :strong_sessions
|
30
30
|
|
31
|
+
# If your User model is named something different than User, you can specify your user model here.
|
32
|
+
attr_accessor :user_class
|
33
|
+
|
31
34
|
def initialize
|
32
35
|
self.allow_multiple_login = true
|
33
36
|
self.token_expiration = nil
|
34
37
|
self.tie_tokens_to_ip = false
|
35
38
|
self.strong_sessions = true
|
39
|
+
self.user_class = "User"
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
data/lib/uber_login/version.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uber_login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Boffa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: useragent
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.10.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Login and logout management with secure "remember me" capabilities and
|
@@ -70,17 +70,17 @@ require_paths:
|
|
70
70
|
- lib
|
71
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- -
|
78
|
+
- - '>='
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.4.5
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Tired of rewriting the login, logout and current_user methods for the millionth
|