feat: Profil + Deconnexion dans le menu header (⚙️)
CI / lint (push) Failing after 2s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after -7s

- Profil: ouvre Config → scroll vers section Profil (langue, nom)
- Deconnexion: logout via /api/auth/logout, visible si auth activee
- Redemarrage: window.location.reload apres logout
This commit is contained in:
2026-06-16 12:17:45 -04:00
parent 0a0cecf178
commit c4b797f0b4
2 changed files with 77 additions and 0 deletions
+27
View File
@@ -617,6 +617,33 @@ function initConfigModal() {
// Load existing keys on modal open
document.getElementById("config-open-btn").addEventListener("click", loadAIKeys);
// Profile menu button: open config modal and scroll to profile section
var profileBtn = document.getElementById("profile-open-btn");
if (profileBtn) {
profileBtn.addEventListener("click", function() {
openConfigModal();
setTimeout(function() {
var el = document.getElementById("cfg-profile");
if (el) el.scrollIntoView({ behavior: 'smooth' });
}, 300);
});
}
// Logout button
var logoutBtn = document.getElementById("logout-btn");
if (logoutBtn && AuthManager && AuthManager._authEnabled) {
// Show if user is logged in
var user = AuthManager.getCurrentUser();
if (user) logoutBtn.style.display = '';
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(); });
}
});
}
// Config nav search
var cfgSearch = document.getElementById("config-nav-search");
if (cfgSearch) {