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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 721f8e38c433954e5ba8db0482bd99a1d22bc5be
4
- data.tar.gz: bce1c42caec7d276d0a54a4aae9a447e92ad8dd4
3
+ metadata.gz: a0750005f312781bb6b816fd972796ef8a0ddd98
4
+ data.tar.gz: f7350c0b084ed528cf5d4228bb940dc63b3faf75
5
5
  SHA512:
6
- metadata.gz: de1b61f6d168f52317cc248cafac501364af37cff355e3ca258cb33c70b1565b8093a5a2b89c81435920167e15be7e81ac1e7aa54a37ebf26539ec99cd092c0e
7
- data.tar.gz: 427175384881e617289b231c63f629710cd3c7c53a54f9c3d971e3f4ec2ed2bb2640c03c614ba46948ca1f4e363ce7c4d2686e82b1c918d1d8e3ac7c6817812e
6
+ metadata.gz: 9dc85c037deb3ec2c05b83a1e4d456503ad7866b7f4fd5a98926a32298f4503a35c23a7371181d448b3ea8785e34a6a88e61aa70aed9c9432b9727abdde437fc
7
+ data.tar.gz: bc3089c0de810207c1f091d02389f194bbdc214ab8e363a7bd6e3fe9e3d4af6707c3421888061855394c2c17921ff1ed87eac9ce35c61765623bf6ff32d8db26
@@ -68,18 +68,31 @@ module Authie
68
68
  raise InactiveSession, "Session is no longer active"
69
69
  end
70
70
 
71
- if self.expires_at && self.expires_at < Time.now
71
+ if self.expired?
72
72
  invalidate!
73
73
  raise ExpiredSession, "Persistent session has expired"
74
74
  end
75
75
 
76
- if self.expires_at.nil? && self.last_activity_at && self.last_activity_at < Authie.config.session_inactivity_timeout.ago
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!
@@ -1,3 +1,3 @@
1
1
  module Authie
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
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.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-16 00:00:00.000000000 Z
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: