mirror of
https://github.com/zadam/trilium.git
synced 2025-03-04 02:53:30 +08:00
logout detection - if user is logged out then we redirect to login page
This commit is contained in:
parent
734b45dc67
commit
470e1fc19f
1 changed files with 15 additions and 4 deletions
|
@ -89,12 +89,23 @@ let globalEncryptedDataKey;
|
|||
let globalFullLoadTime;
|
||||
|
||||
setInterval(() => {
|
||||
$.get(baseApiUrl + 'audit/' + globalFullLoadTime).then(resp => {
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'audit/' + globalFullLoadTime,
|
||||
type: 'GET',
|
||||
success: function (resp) {
|
||||
if (resp.changed) {
|
||||
window.location.reload(true);
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
401: function() {
|
||||
// if the user got logged out then we should display the page
|
||||
// here we do that by reloading which will force the redirect if the user is really logged out
|
||||
window.location.reload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 60 * 1000);
|
||||
}, 10 * 1000);
|
||||
|
||||
$(function(){
|
||||
$.get(baseApiUrl + 'tree').then(resp => {
|
||||
|
|
Loading…
Reference in a new issue