fix: bouton Enregistrer + Deconnexion dans Profil — style harmonieux
- config-save-btn: fond accent, texte blanc, border-radius 6px - Bouton Deconnexion: fond danger-bg, texte danger - Logout dans initProfile via /api/auth/logout
This commit is contained in:
@@ -1546,6 +1546,7 @@ function initProfile() {
|
||||
var langSel = document.getElementById('profile-lang');
|
||||
var nameInp = document.getElementById('profile-name');
|
||||
var saveBtn = document.getElementById('profile-save');
|
||||
var logoutBtn = document.getElementById('profile-logout');
|
||||
var savedEl = document.getElementById('profile-saved');
|
||||
if (!langSel || !saveBtn) return;
|
||||
|
||||
@@ -1564,4 +1565,15 @@ function initProfile() {
|
||||
if (savedEl) { savedEl.style.display = 'inline'; setTimeout(function() { savedEl.style.display = 'none'; }, 2000); }
|
||||
} catch(e) {}
|
||||
});
|
||||
|
||||
// Logout button
|
||||
if (logoutBtn) {
|
||||
logoutBtn.addEventListener('click', function() {
|
||||
if (confirm('Voulez-vous vraiment vous deconnecter ?')) {
|
||||
fetch('/api/auth/logout', { method: 'POST' })
|
||||
.then(function() { window.location.reload(); })
|
||||
.catch(function() { window.location.reload(); });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user