session-check 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ module SessionCheckHelper
2
+
3
+ def session_check
4
+ "<script>
5
+ var session_time_left = #{Devise.timeout_in};
6
+ var session_check = function(){
7
+ session_time_left = session_time_left - 10;
8
+ if (session_time_left < 0){
9
+ window.location = '/users/sign_in';
10
+ }
11
+ setTimeout(session_check, 10000);
12
+ }
13
+ setTimeout(session_check, 10000);
14
+ $.ajaxSetup({
15
+ complete: function(xhr) {
16
+ session_time_left = #{Devise.timeout_in};
17
+ }
18
+ });</script>".html_safe
19
+ end
20
+
21
+ end
@@ -1,5 +1,5 @@
1
1
  module Session
2
2
  module Check
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -34,6 +34,7 @@ executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
+ - app/helpers/session_check_helper.rb
37
38
  - lib/session/check/version.rb
38
39
  - lib/session/check.rb
39
40
  - README.md