Hi,
I need to check whether the user is logged in and redirect it to the login page if not.
I added the following code in app.js :
function start_event(mode, url, params, xhr, headers, data, promise) {
if (promise)
promise.then(null,
function (err) {
if (err.status === 401) {
window.location.href = "/login"
}
}
);
}
webix.attachEvent("onBeforeAjax", start_event);
It works, but if user isn’t authorized then main page and browser authorization dialog show for a moment before redirect to the login page.
How to prevent that?