Rewrite session check component in vanilla js

This commit is contained in:
Frederic Guillot
2016-12-10 13:05:35 -05:00
parent c0049ed7e6
commit 90c9e86461
4 changed files with 16 additions and 23 deletions

View File

@@ -1,21 +0,0 @@
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");
}
}
});
}
};