authie 1.2.2 → 1.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/authie/session.rb +15 -2
- data/lib/authie/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: a0750005f312781bb6b816fd972796ef8a0ddd98
|
4
|
+
data.tar.gz: f7350c0b084ed528cf5d4228bb940dc63b3faf75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc85c037deb3ec2c05b83a1e4d456503ad7866b7f4fd5a98926a32298f4503a35c23a7371181d448b3ea8785e34a6a88e61aa70aed9c9432b9727abdde437fc
|
7
|
+
data.tar.gz: bc3089c0de810207c1f091d02389f194bbdc214ab8e363a7bd6e3fe9e3d4af6707c3421888061855394c2c17921ff1ed87eac9ce35c61765623bf6ff32d8db26
|
data/lib/authie/session.rb
CHANGED
@@ -68,18 +68,31 @@ module Authie
|
|
68
68
|
raise InactiveSession, "Session is no longer active"
|
69
69
|
end
|
70
70
|
|
71
|
-
if self.
|
71
|
+
if self.expired?
|
72
72
|
invalidate!
|
73
73
|
raise ExpiredSession, "Persistent session has expired"
|
74
74
|
end
|
75
75
|
|
76
|
-
if self.
|
76
|
+
if self.inactive?
|
77
77
|
invalidate!
|
78
78
|
raise InactiveSession, "Non-persistent session has expired"
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
# Has this persistent session expired?
|
84
|
+
def expired?
|
85
|
+
self.expires_at &&
|
86
|
+
self.expires_at < Time.now
|
87
|
+
end
|
88
|
+
|
89
|
+
# Has a non-persistent session become inactive?
|
90
|
+
def inactive?
|
91
|
+
self.expires_at.nil? &&
|
92
|
+
self.last_activity_at &&
|
93
|
+
self.last_activity_at < Authie.config.session_inactivity_timeout.ago
|
94
|
+
end
|
95
|
+
|
83
96
|
# Allow this session to persist rather than expiring at the end of the
|
84
97
|
# current browser session
|
85
98
|
def persist!
|
data/lib/authie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Rails library for storing user sessions in a backend database
|
14
14
|
email:
|