When a user is connected to the administration interface, they will be redirected automatically to the login screen upon visiting a new page if their session expires. However, if the user doesn't navigate away from the page they won't be redirected, which can be problematic for asynchronous javascript.
In most cases, this is not critical (datatables stuck on "Processing..." or vague error messages), but in some cases it can cause problems. For example, when updating settings in Administration/Settings the ajax succeeds (the redirection to the login page returns a success) and the "settings updated" message is shown, which is wrong.
This adds a check to ajax calls to test if returned data is html (more specifically the login form) and reloads to page, which will then cause a redirect to the login.
When a user is connected to the administration interface, they will be redirected automatically to the login screen upon visiting a new page if their session expires. However, if the user doesn't navigate away from the page they won't be redirected, which can be problematic for asynchronous javascript.
In most cases, this is not critical (datatables stuck on "Processing..." or vague error messages), but in some cases it can cause problems. For example, when updating settings in Administration/Settings the ajax succeeds (the redirection to the login page returns a success) and the "settings updated" message is shown, which is wrong.
This adds a check to ajax calls to test if returned data is html (more specifically the login form) and reloads to page, which will then cause a redirect to the login.