diff --git a/renderer/app.js b/renderer/app.js index 4f0ef31..a993225 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -3218,13 +3218,24 @@ async function checkSingleAccount(accountId) { updateAccountCard(accountId); } -function getCredsFieldsHtml(authType, account) { +// Per-hoster overrides for the login form. VOE only accepts emails — the +// generic "Username / E-Mail" label sent users down a confusing rabbit hole +// (login fails → upload fetches login redirect → "CSRF token nicht gefunden"). +// Other hosters that genuinely accept either keep the generic wording. +const LOGIN_FIELD_LABELS = { + 'voe.sx': { label: 'E-Mail', placeholder: 'E-Mail-Adresse', inputType: 'email' } +}; + +function getCredsFieldsHtml(authType, account, hoster) { account = account || {}; if (authType === 'login') { + const fld = (hoster && LOGIN_FIELD_LABELS[hoster]) || { + label: 'Username / E-Mail', placeholder: 'Username oder E-Mail', inputType: 'text' + }; return `
- - + +
@@ -3263,7 +3274,7 @@ function openAccountModal(editAccountId) { subtitle.textContent = `Zugangsdaten für ${getAccountDisplayName(found.name, found.account)} bearbeiten.`; hosterRow.style.display = 'none'; saveBtn.textContent = 'Speichern & prüfen'; - credsContainer.innerHTML = getCredsFieldsHtml(found.account.authType || 'login', found.account); + credsContainer.innerHTML = getCredsFieldsHtml(found.account.authType || 'login', found.account, found.name); } else { // Add mode — always show all options (multiple accounts per hoster allowed) title.textContent = 'Account hinzufügen'; @@ -3274,7 +3285,7 @@ function openAccountModal(editAccountId) { `` ).join(''); const firstOpt = HOSTER_ADD_OPTIONS[0]; - credsContainer.innerHTML = getCredsFieldsHtml(firstOpt.authType, {}); + credsContainer.innerHTML = getCredsFieldsHtml(firstOpt.authType, {}, firstOpt.value); } // Toggle visibility buttons @@ -3890,7 +3901,7 @@ function setupListeners() { const opt = HOSTER_ADD_OPTIONS.find(o => o.value === e.target.value); const authType = opt ? opt.authType : 'login'; const credsContainer = document.getElementById('accountCredsFields'); - credsContainer.innerHTML = getCredsFieldsHtml(authType, {}); + credsContainer.innerHTML = getCredsFieldsHtml(authType, {}, e.target.value); credsContainer.querySelectorAll('.toggle-vis').forEach(btn => { btn.addEventListener('click', () => { const input = btn.previousElementSibling;