auto-session-timeout 1.1 → 1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/minitest.yml +40 -2
- data/auto-session-timeout.gemspec +2 -2
- data/lib/auto/session/timeout/version.rb +1 -1
- data/lib/auto_session_timeout.rb +6 -7
- data/test/test_helper.rb +1 -0
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cbff7599142488302aca0c2f48f78dcab95f30345ac08db6f2e4eb2f331f151
|
4
|
+
data.tar.gz: b823d5db838ea10df6df27bedca3534f4211e5de68f4059169a8167d6af42728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a626e3ef8d007bd70380d3e9c79d31adf6eab1d801427322b03bc9ec930fd3fa0eafcb9d84862e6f51682b37ec4ebb76a7929876e5d4e7753366d366407bc5e2
|
7
|
+
data.tar.gz: 279da3ab5573c7855eb8824143761495f3b2091100956b0ccd6bf9330bfe960bf1356c31e821d45a2e8228793ccab6b3fd05300175594787f32c4939416ef5e2
|
@@ -12,8 +12,8 @@ jobs:
|
|
12
12
|
runs-on: ubuntu-latest
|
13
13
|
strategy:
|
14
14
|
matrix:
|
15
|
-
rails-version: ['3.2', '4.0', '4.1', '4.2', '5.0', '5.1', '5.2', '6.0', '6.1', '7.0.1', '7.1']
|
16
|
-
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
|
15
|
+
rails-version: ['3.2', '4.0', '4.1', '4.2', '5.0', '5.1', '5.2', '6.0', '6.1', '7.0.1', '7.1', '7.2', '8.0']
|
16
|
+
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
|
17
17
|
exclude:
|
18
18
|
- rails-version: '3.2'
|
19
19
|
ruby-version: '2.7'
|
@@ -23,6 +23,8 @@ jobs:
|
|
23
23
|
ruby-version: '3.1'
|
24
24
|
- rails-version: '3.2'
|
25
25
|
ruby-version: '3.2'
|
26
|
+
- rails-version: '3.2'
|
27
|
+
ruby-version: '3.3'
|
26
28
|
|
27
29
|
- rails-version: '4.0'
|
28
30
|
ruby-version: '2.7'
|
@@ -32,6 +34,8 @@ jobs:
|
|
32
34
|
ruby-version: '3.1'
|
33
35
|
- rails-version: '4.0'
|
34
36
|
ruby-version: '3.2'
|
37
|
+
- rails-version: '4.0'
|
38
|
+
ruby-version: '3.3'
|
35
39
|
|
36
40
|
- rails-version: '4.1'
|
37
41
|
ruby-version: '2.7'
|
@@ -41,6 +45,8 @@ jobs:
|
|
41
45
|
ruby-version: '3.1'
|
42
46
|
- rails-version: '4.1'
|
43
47
|
ruby-version: '3.2'
|
48
|
+
- rails-version: '4.1'
|
49
|
+
ruby-version: '3.3'
|
44
50
|
|
45
51
|
- rails-version: '4.2'
|
46
52
|
ruby-version: '2.4'
|
@@ -52,6 +58,8 @@ jobs:
|
|
52
58
|
ruby-version: '3.1'
|
53
59
|
- rails-version: '4.2'
|
54
60
|
ruby-version: '3.2'
|
61
|
+
- rails-version: '4.2'
|
62
|
+
ruby-version: '3.3'
|
55
63
|
|
56
64
|
- rails-version: '5.0'
|
57
65
|
ruby-version: '2.4'
|
@@ -61,6 +69,8 @@ jobs:
|
|
61
69
|
ruby-version: '3.1'
|
62
70
|
- rails-version: '5.0'
|
63
71
|
ruby-version: '3.2'
|
72
|
+
- rails-version: '5.0'
|
73
|
+
ruby-version: '3.3'
|
64
74
|
|
65
75
|
- rails-version: '5.1'
|
66
76
|
ruby-version: '2.4'
|
@@ -70,6 +80,8 @@ jobs:
|
|
70
80
|
ruby-version: '3.1'
|
71
81
|
- rails-version: '5.1'
|
72
82
|
ruby-version: '3.2'
|
83
|
+
- rails-version: '5.1'
|
84
|
+
ruby-version: '3.3'
|
73
85
|
|
74
86
|
- rails-version: '5.2'
|
75
87
|
ruby-version: '2.4'
|
@@ -79,6 +91,8 @@ jobs:
|
|
79
91
|
ruby-version: '3.1'
|
80
92
|
- rails-version: '5.2'
|
81
93
|
ruby-version: '3.2'
|
94
|
+
- rails-version: '5.2'
|
95
|
+
ruby-version: '3.3'
|
82
96
|
|
83
97
|
- rails-version: '6.0'
|
84
98
|
ruby-version: '2.4'
|
@@ -99,6 +113,30 @@ jobs:
|
|
99
113
|
ruby-version: '2.5'
|
100
114
|
- rails-version: '7.1'
|
101
115
|
ruby-version: '2.6'
|
116
|
+
|
117
|
+
- rails-version: '7.2'
|
118
|
+
ruby-version: '2.4'
|
119
|
+
- rails-version: '7.2'
|
120
|
+
ruby-version: '2.5'
|
121
|
+
- rails-version: '7.2'
|
122
|
+
ruby-version: '2.6'
|
123
|
+
- rails-version: '7.2'
|
124
|
+
ruby-version: '2.7'
|
125
|
+
- rails-version: '7.2'
|
126
|
+
ruby-version: '3.0'
|
127
|
+
|
128
|
+
- rails-version: '8.0'
|
129
|
+
ruby-version: '2.4'
|
130
|
+
- rails-version: '8.0'
|
131
|
+
ruby-version: '2.5'
|
132
|
+
- rails-version: '8.0'
|
133
|
+
ruby-version: '2.6'
|
134
|
+
- rails-version: '8.0'
|
135
|
+
ruby-version: '2.7'
|
136
|
+
- rails-version: '8.0'
|
137
|
+
ruby-version: '3.0'
|
138
|
+
- rails-version: '8.0'
|
139
|
+
ruby-version: '3.1'
|
102
140
|
steps:
|
103
141
|
- uses: actions/checkout@v2
|
104
142
|
- name: Set up Ruby
|
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "actionpack", [">= 3.2", "<
|
22
|
-
spec.add_development_dependency "bundler", "~> 2
|
21
|
+
spec.add_dependency "actionpack", [">= 3.2", "< 8.1"]
|
22
|
+
spec.add_development_dependency "bundler", "~> 2"
|
23
23
|
spec.add_development_dependency "rake", "~> 13.0"
|
24
24
|
spec.add_development_dependency "minitest", [">= 4.2", "< 6"]
|
25
25
|
end
|
data/lib/auto_session_timeout.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
module AutoSessionTimeout
|
2
|
-
|
2
|
+
|
3
3
|
def self.included(controller)
|
4
4
|
controller.extend ClassMethods
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
module ClassMethods
|
8
8
|
def auto_session_timeout(seconds=nil)
|
9
|
-
protect_from_forgery except: [:active, :timeout]
|
10
9
|
prepend_before_action do |c|
|
11
10
|
if session_expired?(c) && !signing_in?(c)
|
12
11
|
handle_session_reset(c)
|
@@ -18,18 +17,18 @@ module AutoSessionTimeout
|
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
def auto_session_timeout_actions
|
23
22
|
define_method(:active) { render_session_status }
|
24
23
|
define_method(:timeout) { render_session_timeout }
|
25
24
|
end
|
26
25
|
end
|
27
|
-
|
26
|
+
|
28
27
|
def render_session_status
|
29
28
|
response.headers["Etag"] = nil # clear etags to prevent caching
|
30
29
|
render plain: !!current_user, status: 200
|
31
30
|
end
|
32
|
-
|
31
|
+
|
33
32
|
def render_session_timeout
|
34
33
|
flash[:notice] = t("devise.failure.timeout", default: "Your session has timed out.")
|
35
34
|
redirect_to sign_in_path
|
@@ -54,7 +53,7 @@ module AutoSessionTimeout
|
|
54
53
|
rescue
|
55
54
|
"/login"
|
56
55
|
end
|
57
|
-
|
56
|
+
|
58
57
|
end
|
59
58
|
|
60
59
|
ActionController::Base.send :include, AutoSessionTimeout
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto-session-timeout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Bass
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: actionpack
|
@@ -19,7 +18,7 @@ dependencies:
|
|
19
18
|
version: '3.2'
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
21
|
+
version: '8.1'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,21 +28,21 @@ dependencies:
|
|
29
28
|
version: '3.2'
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
31
|
+
version: '8.1'
|
33
32
|
- !ruby/object:Gem::Dependency
|
34
33
|
name: bundler
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
36
35
|
requirements:
|
37
36
|
- - "~>"
|
38
37
|
- !ruby/object:Gem::Version
|
39
|
-
version: '2
|
38
|
+
version: '2'
|
40
39
|
type: :development
|
41
40
|
prerelease: false
|
42
41
|
version_requirements: !ruby/object:Gem::Requirement
|
43
42
|
requirements:
|
44
43
|
- - "~>"
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
version: '2
|
45
|
+
version: '2'
|
47
46
|
- !ruby/object:Gem::Dependency
|
48
47
|
name: rake
|
49
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +104,6 @@ homepage: http://github.com/pelargir/auto-session-timeout
|
|
105
104
|
licenses:
|
106
105
|
- MIT
|
107
106
|
metadata: {}
|
108
|
-
post_install_message:
|
109
107
|
rdoc_options: []
|
110
108
|
require_paths:
|
111
109
|
- lib
|
@@ -120,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
118
|
- !ruby/object:Gem::Version
|
121
119
|
version: '0'
|
122
120
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
124
|
-
signing_key:
|
121
|
+
rubygems_version: 3.7.1
|
125
122
|
specification_version: 4
|
126
123
|
summary: Provides automatic session timeout in a Rails application.
|
127
124
|
test_files:
|