Files
edx-platform/lms/static/js/ajax-error.js
Omar Al-Ithawi 64f8c01a92 Remove "edX" from the logout popup message
Not using `settings.PLATFORM_NAME` because sharing it with this script would need too much platform changes for this small error.

Removing the word "edX" makes the statement more accurate for other forks. Generally there shouldn't be any mention of "edX" in the code.
2021-05-12 13:49:38 +03:00

16 lines
587 B
JavaScript

$(document).ajaxError(function(event, jXHR) {
if (jXHR.status === 403 && jXHR.responseText === 'Unauthenticated') {
var message = gettext(
'You have been logged out of your account. ' +
'Click Okay to log in again now. ' +
'Click Cancel to stay on this page ' +
'(you must log in again to save your work).'
);
if (window.confirm(message)) {
var currentLocation = window.location.pathname;
window.location.href = '/login?next=' + encodeURIComponent(currentLocation);
}
}
});