Start every session through session.php; idle timeout, app access and auth status codes
This commit is contained in:
@@ -905,6 +905,17 @@ function ajax_request(options) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Session ended on the server (idle timeout, not signed in, password changed):
|
||||
// drop per-tab data and go back to the sign-in form.
|
||||
const endedCodes = ['session_expired', 'auth_required', 'password_changed'];
|
||||
if (xhr?.status === 401 && endedCodes.includes(xhr?.responseJSON?.code)) {
|
||||
try { sessionStorage.clear(); } catch (e) {}
|
||||
bootbox.alert(escape_html(xhr.responseJSON.message || 'Please sign in again.'), function() {
|
||||
window.location.href = server_url + 'login/index.php';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// File / payload too large (nginx 413)
|
||||
if (xhr?.status === 413) {
|
||||
bootbox.alert('The file you selected is too large. Please use an image under 2 MB and try again.');
|
||||
|
||||
Reference in New Issue
Block a user