Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(admin): reload pages when an auth proxy blocks navigation (#3480)

Hampusa39410623e8e
diff --git a/fluxer_admin/src/templates/layout_scripts.rs b/fluxer_admin/src/templates/layout_scripts.rs
index 828410887..1578935f2 100644
--- a/fluxer_admin/src/templates/layout_scripts.rs
+++ b/fluxer_admin/src/templates/layout_scripts.rs
@@ -571,6 +571,12 @@ pub const HTMX_FLASH_SCRIPT: &str = r#"
showToast(failed ? 'error' : 'success', isLoginResponse(xhr) ? 'Session expired. Sign in again.' : failed ? 'Action failed.' : 'Done.');
markToastHandled(event.detail);
}, true);
+
+ document.addEventListener('htmx:sendError', function (event) {
+ if (requestVerb(event.detail) !== 'get') return;
+ var path = event.detail.pathInfo && event.detail.pathInfo.finalRequestPath;
+ if (path) window.location.assign(path);
+ }, true);
})();
"#;