Redirect to login page when auto-refreshing a (part of a) page while being logged out (#5951)
This commit is contained in:
@@ -440,6 +440,12 @@ if (!class_exists('destinations')) {
|
||||
//alert(action);
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
var url = new URL(this.xmlHttp.responseURL);
|
||||
if (/login\.php$/.test(url.pathname)) {
|
||||
// You are logged out. Not much we can de here.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
document.getElementById(id).innerHTML = this.responseText;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user