auto-session-timeout 1.0 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/minitest.yml +59 -5
- data/CHANGELOG +4 -0
- data/auto-session-timeout.gemspec +1 -1
- data/lib/auto/session/timeout/version.rb +1 -1
- data/lib/auto_session_timeout.rb +6 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2f318d49f7af1c0c762899a019c9baa884695f62489264c78d8403099c3d2e
|
4
|
+
data.tar.gz: ebfe4d7734bb6695196a8b27ed44cc46d41523e87f5c07568eccea17e53885fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f9c785d016c3962f0e38cb10e72abce48a3110f271822725fc933141f1e29431c4effe6f7acccaf4be0834d189efca7c29eca7f911b75c21846e6f1eaa06a95
|
7
|
+
data.tar.gz: 4388192be5578966d397192487a886a36311a4525a5273112c0b9086f6441cf2414f8e490560dcf1fda88023d9d54c8e3db74ab5c096ee8c809e8e687e09e8d2
|
@@ -12,37 +12,73 @@ 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']
|
16
|
-
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0']
|
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']
|
16
|
+
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
|
17
17
|
exclude:
|
18
18
|
- rails-version: '3.2'
|
19
19
|
ruby-version: '2.7'
|
20
20
|
- rails-version: '3.2'
|
21
21
|
ruby-version: '3.0'
|
22
|
+
- rails-version: '3.2'
|
23
|
+
ruby-version: '3.1'
|
24
|
+
- rails-version: '3.2'
|
25
|
+
ruby-version: '3.2'
|
22
26
|
|
23
27
|
- rails-version: '4.0'
|
24
28
|
ruby-version: '2.7'
|
25
29
|
- rails-version: '4.0'
|
26
30
|
ruby-version: '3.0'
|
31
|
+
- rails-version: '4.0'
|
32
|
+
ruby-version: '3.1'
|
33
|
+
- rails-version: '4.0'
|
34
|
+
ruby-version: '3.2'
|
27
35
|
|
28
36
|
- rails-version: '4.1'
|
29
37
|
ruby-version: '2.7'
|
30
38
|
- rails-version: '4.1'
|
31
39
|
ruby-version: '3.0'
|
40
|
+
- rails-version: '4.1'
|
41
|
+
ruby-version: '3.1'
|
42
|
+
- rails-version: '4.1'
|
43
|
+
ruby-version: '3.2'
|
32
44
|
|
45
|
+
- rails-version: '4.2'
|
46
|
+
ruby-version: '2.4'
|
33
47
|
- rails-version: '4.2'
|
34
48
|
ruby-version: '2.7'
|
35
49
|
- rails-version: '4.2'
|
36
50
|
ruby-version: '3.0'
|
51
|
+
- rails-version: '4.2'
|
52
|
+
ruby-version: '3.1'
|
53
|
+
- rails-version: '4.2'
|
54
|
+
ruby-version: '3.2'
|
37
55
|
|
56
|
+
- rails-version: '5.0'
|
57
|
+
ruby-version: '2.4'
|
38
58
|
- rails-version: '5.0'
|
39
59
|
ruby-version: '3.0'
|
60
|
+
- rails-version: '5.0'
|
61
|
+
ruby-version: '3.1'
|
62
|
+
- rails-version: '5.0'
|
63
|
+
ruby-version: '3.2'
|
40
64
|
|
65
|
+
- rails-version: '5.1'
|
66
|
+
ruby-version: '2.4'
|
41
67
|
- rails-version: '5.1'
|
42
68
|
ruby-version: '3.0'
|
69
|
+
- rails-version: '5.1'
|
70
|
+
ruby-version: '3.1'
|
71
|
+
- rails-version: '5.1'
|
72
|
+
ruby-version: '3.2'
|
43
73
|
|
74
|
+
- rails-version: '5.2'
|
75
|
+
ruby-version: '2.4'
|
44
76
|
- rails-version: '5.2'
|
45
77
|
ruby-version: '3.0'
|
78
|
+
- rails-version: '5.2'
|
79
|
+
ruby-version: '3.1'
|
80
|
+
- rails-version: '5.2'
|
81
|
+
ruby-version: '3.2'
|
46
82
|
|
47
83
|
- rails-version: '6.0'
|
48
84
|
ruby-version: '2.4'
|
@@ -50,12 +86,30 @@ jobs:
|
|
50
86
|
- rails-version: '6.1'
|
51
87
|
ruby-version: '2.4'
|
52
88
|
|
53
|
-
- rails-version: '7.0'
|
89
|
+
- rails-version: '7.0.1'
|
90
|
+
ruby-version: '2.4'
|
91
|
+
- rails-version: '7.0.1'
|
92
|
+
ruby-version: '2.5'
|
93
|
+
- rails-version: '7.0.1'
|
94
|
+
ruby-version: '2.6'
|
95
|
+
|
96
|
+
- rails-version: '7.1'
|
97
|
+
ruby-version: '2.4'
|
98
|
+
- rails-version: '7.1'
|
99
|
+
ruby-version: '2.5'
|
100
|
+
- rails-version: '7.1'
|
101
|
+
ruby-version: '2.6'
|
102
|
+
|
103
|
+
- rails-version: '7.2'
|
54
104
|
ruby-version: '2.4'
|
55
|
-
- rails-version: '7.
|
105
|
+
- rails-version: '7.2'
|
56
106
|
ruby-version: '2.5'
|
57
|
-
- rails-version: '7.
|
107
|
+
- rails-version: '7.2'
|
58
108
|
ruby-version: '2.6'
|
109
|
+
- rails-version: '7.2'
|
110
|
+
ruby-version: '2.7'
|
111
|
+
- rails-version: '7.2'
|
112
|
+
ruby-version: '3.0'
|
59
113
|
steps:
|
60
114
|
- uses: actions/checkout@v2
|
61
115
|
- name: Set up Ruby
|
data/CHANGELOG
CHANGED
@@ -18,7 +18,7 @@ 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", "< 7.
|
21
|
+
spec.add_dependency "actionpack", [">= 3.2", "< 7.3"]
|
22
22
|
spec.add_development_dependency "bundler", "~> 2.0"
|
23
23
|
spec.add_development_dependency "rake", "~> 13.0"
|
24
24
|
spec.add_development_dependency "minitest", [">= 4.2", "< 6"]
|
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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Bass
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '7.
|
22
|
+
version: '7.3'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '7.
|
32
|
+
version: '7.3'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
123
|
+
rubygems_version: 3.5.14
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Provides automatic session timeout in a Rails application.
|