auto-session-timeout 1.1 → 1.2

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
  SHA256:
3
- metadata.gz: bb3a8bbb9a5b0edf8b3f334f81bab7d10ae7c2ce696ab9bd722ec8dc842a1ffd
4
- data.tar.gz: 1ec3132a8958ace3d9d06d19a5569eecd3d975f5152e48216dc10cf9f50f0e2d
3
+ metadata.gz: fa2f318d49f7af1c0c762899a019c9baa884695f62489264c78d8403099c3d2e
4
+ data.tar.gz: ebfe4d7734bb6695196a8b27ed44cc46d41523e87f5c07568eccea17e53885fa
5
5
  SHA512:
6
- metadata.gz: 6529e08645e0040a275b746fd11112f69c5b3c27b0da30c55f7ef040e3ae698dc5f41f2ca77e8dd6f141476e44ee9b681e4c7ce6db076248c3ccc7d934debb31
7
- data.tar.gz: 89693f95d759a582b37dcada55a529218e185b014ae391e067243d9a46b07fd833ecbb4d7951ac34dba885126f4f3e658d138dcc61e2dc06e6d0a5fb68cc8f88
6
+ metadata.gz: 2f9c785d016c3962f0e38cb10e72abce48a3110f271822725fc933141f1e29431c4effe6f7acccaf4be0834d189efca7c29eca7f911b75c21846e6f1eaa06a95
7
+ data.tar.gz: 4388192be5578966d397192487a886a36311a4525a5273112c0b9086f6441cf2414f8e490560dcf1fda88023d9d54c8e3db74ab5c096ee8c809e8e687e09e8d2
@@ -12,7 +12,7 @@ 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']
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
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'
@@ -99,6 +99,17 @@ jobs:
99
99
  ruby-version: '2.5'
100
100
  - rails-version: '7.1'
101
101
  ruby-version: '2.6'
102
+
103
+ - rails-version: '7.2'
104
+ ruby-version: '2.4'
105
+ - rails-version: '7.2'
106
+ ruby-version: '2.5'
107
+ - rails-version: '7.2'
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'
102
113
  steps:
103
114
  - uses: actions/checkout@v2
104
115
  - name: Set up Ruby
@@ -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.2"]
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"]
@@ -1,7 +1,7 @@
1
1
  module Auto
2
2
  module Session
3
3
  module Timeout
4
- VERSION = "1.1"
4
+ VERSION = "1.2"
5
5
  end
6
6
  end
7
7
  end
@@ -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.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: 2023-10-24 00:00:00.000000000 Z
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.2'
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.2'
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.4.19
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.