summaryrefslogtreecommitdiff
path: root/assets/js/src/Session.js
blob: c07bc58d24fb0eff130bc97f27b1c3b7aaa5df32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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");
                }
            }
        });
    }
};