summaryrefslogtreecommitdiff
path: root/assets/js/src/Session.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/src/Session.js')
-rw-r--r--assets/js/src/Session.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/assets/js/src/Session.js b/assets/js/src/Session.js
new file mode 100644
index 00000000..c07bc58d
--- /dev/null
+++ b/assets/js/src/Session.js
@@ -0,0 +1,21 @@
+Kanboard.Session = function(app) {
+ this.app = app;
+};
+
+Kanboard.Session.prototype.execute = function() {
+ window.setInterval(this.checkSession, 60000);
+};
+
+Kanboard.Session.prototype.checkSession = function() {
+ if (! $(".form-login").length) {
+ $.ajax({
+ cache: false,
+ url: $("body").data("status-url"),
+ statusCode: {
+ 401: function() {
+ window.location = $("body").data("login-url");
+ }
+ }
+ });
+ }
+};