fixes: password form wrap, collab-buckets csrf race

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.6 committed 2026-04-14 21:23:48 +02:00
1 parent ae974314f9
commit 69ad2c7e71
2 files changed
+13 -3

No files matched your search

+3 -1
View File
@@ -1925,6 +1925,7 @@ if (str_starts_with($route, '/api/')) {
</div> </div>
<div class="border-t border-t-border pt-4"> <div class="border-t border-t-border pt-4">
<div class="font-pixel text-[9px] uppercase tracking-wider text-t-dim mb-3"><i class="ph ph-lock text-xs"></i> change password</div> <div class="font-pixel text-[9px] uppercase tracking-wider text-t-dim mb-3"><i class="ph ph-lock text-xs"></i> change password</div>
<form id="settings-pw-form" onsubmit="return false;">
<div> <div>
<label class="font-pixel text-[9px] text-t-dim uppercase block mb-1">current password</label> <label class="font-pixel text-[9px] text-t-dim uppercase block mb-1">current password</label>
<input id="settings-pw-current" type="password" autocomplete="off" data-1p-ignore data-lpignore="true" class="w-full bg-t-bg border border-t-border text-t-bright px-3 py-2 text-xs focus:border-t-accent focus:outline-none font-mono"> <input id="settings-pw-current" type="password" autocomplete="off" data-1p-ignore data-lpignore="true" class="w-full bg-t-bg border border-t-border text-t-bright px-3 py-2 text-xs focus:border-t-accent focus:outline-none font-mono">
@@ -1938,9 +1939,10 @@ if (str_starts_with($route, '/api/')) {
<input id="settings-pw-confirm" type="password" autocomplete="new-password" class="w-full bg-t-bg border border-t-border text-t-bright px-3 py-2 text-xs focus:border-t-accent focus:outline-none font-mono"> <input id="settings-pw-confirm" type="password" autocomplete="new-password" class="w-full bg-t-bg border border-t-border text-t-bright px-3 py-2 text-xs focus:border-t-accent focus:outline-none font-mono">
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<button id="settings-pw-save" class="flex items-center gap-1.5 px-3 py-1.5 text-xs border border-t-accent text-t-accent hover:bg-t-accent/10 transition-colors"><i class="ph ph-floppy-disk text-sm"></i><span class="font-pixel text-[10px]">Change password</span></button> <button id="settings-pw-save" type="button" class="flex items-center gap-1.5 px-3 py-1.5 text-xs border border-t-accent text-t-accent hover:bg-t-accent/10 transition-colors"><i class="ph ph-floppy-disk text-sm"></i><span class="font-pixel text-[10px]">Change password</span></button>
<span id="settings-pw-status" class="font-pixel text-[9px] text-t-dim"></span> <span id="settings-pw-status" class="font-pixel text-[9px] text-t-dim"></span>
</div> </div>
</form>
</div> </div>
</div> </div>
</div> </div>
@@ -908,10 +908,18 @@ async function init() {
startPolling(); startPolling();
} }
// Defer init until the CSRF token is live — `checkAuth()` sets it async on
// boot, and firing POST /api/collab-buckets/poll before that racing lookup
// resolves returns 403. If the token is already in the util state when we
// load (e.g. fast reload, cached session), kick off init straight away.
function bootWhenCsrfReady() {
if (hyprcrd?.util?.csrf?.()) { init(); return; }
hyprcrd?.hooks?.on?.('csrf.ready', () => init());
}
if (document.readyState === 'loading') { if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init, { once: true }); document.addEventListener('DOMContentLoaded', bootWhenCsrfReady, { once: true });
} else { } else {
init(); bootWhenCsrfReady();
} }
hyprcrd.registerPlugin?.({ hyprcrd.registerPlugin?.({