Prestiti Personali
Esito in 1 Ora Β· Confronto gratuito
RICHIEDI ORA β†’

βš™οΈ Le mie impostazioni

βœ“ Impostazioni salvate
Esito Rapido
Prestiti Online
Risposta Immediata Β· Senza pensieri
SCOPRI β†’
Esito Prestiti
Confronta i Prestiti
Le migliori offerte in pochi click
CONFRONTA β†’

πŸ“© Resta aggiornato

Ricevi le ultime notizie Ferrari direttamente nella tua email

πŸ”’ Privacy & GDPR

Esercita i tuoi diritti GDPR sui tuoi dati personali.

'); w.document.close(); w.print(); } async function tfaDisable() { var pw = prompt('Per disattivare 2FA, inserisci la tua password:'); if (!pw) return; var code = prompt('Inserisci anche il codice TOTP corrente dalla tua app authenticator (per conferma):'); if (!code) return; try { var r = await fetch('/api/me/2fa/disable', { method: 'POST', headers: TFA_HEADERS(), body: JSON.stringify({ password: pw, token: code }) }); var d = await r.json(); if (!r.ok) { alert('Errore: ' + (d.error || 'sconosciuto')); return; } alert('2FA disattivato.'); tfaLoadStatus(); } catch(e) { alert('Errore: ' + e.message); } } async function tfaRegenBackup() { var pw = prompt('Per rigenerare i codici di backup, inserisci la tua password:'); if (!pw) return; if (!confirm('I codici precedenti saranno INVALIDATI. Sei sicuro?')) return; try { var r = await fetch('/api/me/2fa/regenerate-backup', { method: 'POST', headers: TFA_HEADERS(), body: JSON.stringify({ password: pw }) }); var d = await r.json(); if (!r.ok) { alert('Errore: ' + (d.error || 'sconosciuto')); return; } document.getElementById('tfa-codes-list').textContent = d.backup_codes.join('\n'); tfaShow('tfa-show-codes'); } catch(e) { alert('Errore: ' + e.message); } } // Auto-formatting input TOTP code document.addEventListener('DOMContentLoaded', function() { var codeInput = document.getElementById('tfa-code'); if (codeInput) { codeInput.addEventListener('input', function() { this.value = this.value.replace(/\D/g, '').substring(0, 6); if (this.value.length === 6) tfaEnable(); }); } // Carica status all'apertura pagina setTimeout(tfaLoadStatus, 600); // dopo loadPrefs setTimeout(loadPushUI, 800); }); // ========== PUSH NOTIFICATIONS UI ========== async function loadPushUI() { const ui = document.getElementById('vfPushUI'); if (!ui) return; if (!window.VfPush) { ui.innerHTML = '
⚠️ Il tuo browser non supporta le notifiche push.
'; return; } try { const status = await window.VfPush.getStatus(); if (!status.supported) { ui.innerHTML = '
⚠️ Il tuo browser non supporta le notifiche push.
'; return; } if (status.permission === 'denied') { ui.innerHTML = '
❌ Permesso negato
Hai negato le notifiche per questo sito. Per attivarle, vai nelle impostazioni del browser e cambia il permesso a "Consenti".
'; return; } if (status.subscribed) { ui.innerHTML = `
βœ… Notifiche attive
Riceverai avvisi push per i nuovi articoli piΓΉ importanti.
`; } else { ui.innerHTML = `
πŸ”• Notifiche non attive
Attiva per ricevere avvisi push sui nuovi contenuti Ferrari.
`; } } catch (e) { ui.innerHTML = '
Errore: ' + e.message + '
'; } } async function vfPushOn() { try { await window.VfPush.subscribe(); loadPushUI(); } catch (e) { alert('Errore: ' + e.message); } } async function vfPushOff() { if (!confirm('Disattivare le notifiche push?')) return; try { await window.VfPush.unsubscribe(); loadPushUI(); } catch (e) { alert('Errore: ' + e.message); } } async function vfPushTest() { const token = localStorage.getItem('vf_token'); if (!token) { alert('Devi essere loggato per testare'); return; } try { const r = await fetch('/api/push/test', { method: 'POST', headers: { 'Authorization': 'Bearer ' + token } }); const d = await r.json(); if (!r.ok) { alert('Errore: ' + (d.error || 'sconosciuto')); } else { alert('βœ… Notifica di test inviata! Dovrebbe arrivare entro pochi secondi.'); } } catch (e) { alert('Errore: ' + e.message); } }