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.
- data/app/helpers/session_check_helper.rb +17 -14
- data/config/routes.rb +3 -0
- data/lib/session/check/version.rb +1 -1
- data/lib/session/check.rb +1 -0
- metadata +6 -5
@@ -4,20 +4,23 @@ module SessionCheckHelper
|
|
4
4
|
|
5
5
|
def session_check
|
6
6
|
"<script>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
data/lib/session/check.rb
CHANGED
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.
|
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: '
|
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: '
|
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: []
|