session-check 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/helpers/session_check_helper.rb +9 -7
- data/lib/session/check/version.rb +1 -1
- data/lib/session/check.rb +1 -4
- metadata +1 -1
@@ -1,15 +1,17 @@
|
|
1
|
+
require 'devise'
|
2
|
+
|
1
3
|
module SessionCheckHelper
|
2
4
|
|
3
5
|
def session_check
|
4
6
|
"<script>
|
5
7
|
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
|
-
|
12
|
-
}
|
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
|
+
}
|
13
15
|
setTimeout(session_check, 10000);
|
14
16
|
$.ajaxSetup({
|
15
17
|
complete: function(xhr) {
|
data/lib/session/check.rb
CHANGED