Fix non-functional login page after session timeout

This commit is contained in:
Raphael Michel
2023-03-21 17:17:39 +01:00
parent 464a25a678
commit 0121e053f6
2 changed files with 4 additions and 1 deletions

View File

@@ -46,4 +46,5 @@
{% endif %}
</div>
</form>
<!-- pretix-login-marker -->{# marker required for ajax calls to detect that user session is over #}
{% endblock %}

View File

@@ -100,7 +100,9 @@ var i18nToString = function (i18nstring) {
$(document).ajaxError(function (event, jqXHR, settings, thrownError) {
waitingDialog.hide();
var c = $(jqXHR.responseText).filter('.container');
if (c.length > 0) {
if (jqXHR.responseText.indexOf("<!-- pretix-login-marker -->") !== -1) {
location.href = '/control/login?next=' + encodeURIComponent(location.pathname + location.search + location.hash)
} else if (c.length > 0) {
ajaxErrDialog.show(c.first().html());
} else if (thrownError !== "abort" && thrownError !== "") {
console.log(thrownError);