Settings/Contacts (CardDAV): show '(unchanged)' placeholder when password is saved

GET /api/contacts/config masks the saved password as '***' (or ''
when none). Mirror that into the password input's placeholder so users
can see at a glance that a password is on file — matching the email
account form's '(unchanged)' pattern.
This commit is contained in:
pewdiepie-archdaemon
2026-06-11 09:47:28 +09:00
parent f5ad59317c
commit 6fc79e90ac
+5
View File
@@ -4024,6 +4024,11 @@ async function initUnifiedIntegrations() {
try {
const r = await fetch('/api/contacts/config', { credentials: 'same-origin' }); const d = await r.json();
el('uf-carddav-url').value = d.url || ''; el('uf-carddav-user').value = d.username || '';
// Server masks the password as '***' when one is saved (or '' when
// none). Surface that state via the input's placeholder so users
// can tell their password is already on file without us echoing it.
const passInput = el('uf-carddav-pass');
if (passInput && d.password) passInput.placeholder = '(unchanged)';
} catch (_) {}
el('uf-carddav-cancel').addEventListener('click', () => { formEl.style.display = 'none'; });
el('uf-carddav-save').addEventListener('click', async () => {