uber_login 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/uber_login/cookie_manager.rb +7 -2
- data/lib/uber_login/version.rb +1 -1
- data/spec/spec_helper.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjcyNWJjYjgwNTZlYTM0OTBiNjk4Y2YyNTQ2YmY1ODRkYmE4MmIxOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTJmNGMwMzQyOTMxNWE4YjlkYmY2MDYzMzc3YjQwNTMzNjVmOWM3Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjM3OTE0Y2VkZjg2MmU3ODcxMjM1MDU5N2M1OGE1YzNiNjhhMzRhMjE1ZDA3
|
10
|
+
Yzc2ZjUwMTc1ZGJlMWRiOGY2NzYzYzgzZmJhYWNkNmM5NDM3NjY3ZDExZjYw
|
11
|
+
MTI2OTc3ZjVmNDg0MTVhNDViODRlOTQ1NDk0MjY3MDk4ZjE5ODA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTBhOTUxMDBkZmE1YjMxMmQ3NTdmNjhhMWYxOGFjZjk3MjE2ZTkxYjM2ZTk5
|
14
|
+
MzQ1MjMzYWIwYzBlYzQyYzAwNDhhMTlkODYwNTVjM2U4OTkxY2YyZjFiNWQy
|
15
|
+
OThkYzJjZDg4OGVmYzViZTYzYzUzNWYwODgxNTBjNWYyZDllYmE=
|
@@ -15,8 +15,8 @@ module UberLogin
|
|
15
15
|
##
|
16
16
|
# Sets the +:uid+ and +:ulogin+ cookies for next login
|
17
17
|
def persistent_login(uid, composite)
|
18
|
-
|
19
|
-
|
18
|
+
set_cookie(:uid, uid)
|
19
|
+
set_cookie(:ulogin, TokenEncoder.encode_array(composite))
|
20
20
|
end
|
21
21
|
|
22
22
|
##
|
@@ -40,5 +40,10 @@ module UberLogin
|
|
40
40
|
def login_cookies?
|
41
41
|
@cookies[:uid] and @cookies[:ulogin]
|
42
42
|
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def set_cookie(key, value)
|
46
|
+
@cookies.permanent[key] = { value: value, httponly: true, secure: @request.ssl? }
|
47
|
+
end
|
43
48
|
end
|
44
49
|
end
|
data/lib/uber_login/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -6,6 +6,14 @@ class FakeCookieJar < Hash
|
|
6
6
|
def permanent
|
7
7
|
self
|
8
8
|
end
|
9
|
+
|
10
|
+
def []=(key, val)
|
11
|
+
if val.class == Hash
|
12
|
+
super(key, val[:value])
|
13
|
+
else
|
14
|
+
super(key, val)
|
15
|
+
end
|
16
|
+
end
|
9
17
|
end
|
10
18
|
|
11
19
|
class FakeRequest
|
@@ -16,6 +24,10 @@ class FakeRequest
|
|
16
24
|
def user_agent
|
17
25
|
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36"
|
18
26
|
end
|
27
|
+
|
28
|
+
def ssl?
|
29
|
+
true
|
30
|
+
end
|
19
31
|
end
|
20
32
|
|
21
33
|
class ApplicationController
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uber_login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Boffa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: useragent
|
@@ -24,7 +24,8 @@ dependencies:
|
|
24
24
|
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.0
|
27
|
-
description: Login and logout management with secure "remember me" capabilities
|
27
|
+
description: Login and logout management with secure "remember me" capabilities and
|
28
|
+
complete session control. You can even force a user to logout!
|
28
29
|
email: fra.boffa@gmail.com
|
29
30
|
executables: []
|
30
31
|
extensions: []
|