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
+50
View File
@@ -633,6 +633,56 @@
>
</span>
</button>
<button
class="menu-list-row menu-list-button"
id="profile-open-btn"
type="button"
role="menuitem"
>
<span
class="menu-list-icon"
aria-hidden="true"
>
<i
data-lucide="user"
style="width: 17px; height: 17px"
></i>
</span>
<span class="menu-list-content">
<span class="menu-list-title"
>Profil</span
>
<span class="menu-list-subtitle"
>Langue &amp; preferences</span
>
</span>
</button>
<button
class="menu-list-row menu-list-button"
id="logout-btn"
type="button"
role="menuitem"
style="display:none"
>
<span
class="menu-list-icon"
aria-hidden="true"
>
<i
data-lucide="log-out"
style="width: 17px; height: 17px; color: var(--danger)"
></i>
</span>
<span class="menu-list-content">
<span class="menu-list-title"
style="color:var(--danger)"
>Deconnexion</span
>
<span class="menu-list-subtitle"
>Quitter la session</span
>
</span>
</button>
</div>
</div>
</div>
+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) {