session-check 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,20 +4,23 @@ module SessionCheckHelper
4
4
 
5
5
  def session_check
6
6
  "<script>
7
- var session_time_left = #{Devise.timeout_in};
8
- var session_check = function(){
9
- session_time_left = session_time_left - 10;
10
- if (session_time_left < 0){
11
- window.location = '/users/sign_in';
12
- }
13
- setTimeout(session_check, 10000);
14
- }
15
- setTimeout(session_check, 10000);
16
- $.ajaxSetup({
17
- complete: function(xhr) {
18
- session_time_left = #{Devise.timeout_in};
19
- }
20
- });</script>".html_safe
7
+ (function(){
8
+ var session_time_left = #{Devise.timeout_in};
9
+ var session_check = function(){
10
+ session_time_left = session_time_left - 10;
11
+ if (session_time_left < 0){
12
+ window.location = '/users/sign_in';
13
+ }
14
+ setTimeout(session_check, 10000);
15
+ }
16
+ setTimeout(session_check, 10000);
17
+ $.ajaxSetup({
18
+ complete: function(xhr) {
19
+ session_time_left = #{Devise.timeout_in};
20
+ }
21
+ });
22
+ }());
23
+ </script>".html_safe
21
24
  end
22
25
 
23
26
  end
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+
3
+ end
@@ -1,5 +1,5 @@
1
1
  module Session
2
2
  module Check
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
data/lib/session/check.rb CHANGED
@@ -6,6 +6,7 @@ module Session
6
6
  initializer "session-check.loader" do
7
7
  ActiveSupport.on_load :action_controller do
8
8
  helper SessionCheckHelper
9
+ helper_method :session_check
9
10
  end
10
11
  end
11
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: session-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,15 +18,15 @@ dependencies:
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - ! '>='
21
+ - - ! '>'
22
22
  - !ruby/object:Gem::Version
23
- version: '0'
23
+ version: '3.2'
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ! '>'
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: '3.2'
30
30
  description:
31
31
  email:
32
32
  - harry@harrylascelles.com
@@ -37,6 +37,7 @@ files:
37
37
  - app/helpers/session_check_helper.rb
38
38
  - lib/session/check/version.rb
39
39
  - lib/session/check.rb
40
+ - config/routes.rb
40
41
  - README.md
41
42
  homepage: https://github.com/firstbanco/session-check
42
43
  licenses: []