updates from chat
Security and workflow regressions / regression (push) Has been cancelled

This commit is contained in:
2026-10-21 20:41:57 -04:00
parent acc8cb70f5
commit b851712968
19 changed files with 435 additions and 22 deletions
+9 -1
View File
@@ -26,7 +26,15 @@ document.querySelectorAll('.club-action-modal').forEach(modal => {
});
const result = await response.json();
if (!response.ok || !result.ok) throw new Error(result.error || 'Your change could not be saved.');
window.location.assign(result.redirect);
const target = new URL(result.redirect, window.location.href);
if (target.origin !== window.location.origin) throw new Error('The return address could not be verified. Reload this page.');
if (target.pathname === window.location.pathname && target.search === window.location.search) {
// A fragment-only navigation would leave the saved dialog and stale content open.
window.history.replaceState(null, '', target.href);
window.location.reload();
} else {
window.location.assign(target.href);
}
} catch (failure) {
error.textContent = failure instanceof SyntaxError || failure instanceof TypeError
? 'Your change could not be confirmed. Reload the club page before retrying.'