fix: settings logout via inline onclick — bypasses ES module race
- profile-logout now handles logout directly via onclick attribute in HTML - Calls window.handleLogout() (auth.js global) or direct fetch fallback - Removed broken JS handler from config.js to avoid double execution
This commit is contained in:
+1
-1
@@ -2006,7 +2006,7 @@
|
||||
<input type="text" id="profile-name" class="config-input" placeholder="Votre nom" maxlength="60">
|
||||
</div>
|
||||
<button class="config-save-btn" id="profile-save" data-i18n="config.save">Enregistrer</button>
|
||||
<button class="config-save-btn" id="profile-logout" style="background:var(--danger-bg);color:var(--danger);border-color:var(--danger);margin-left:8px" data-i18n="config.logout">Déconnexion</button>
|
||||
<button class="config-save-btn" id="profile-logout" style="background:var(--danger-bg);color:var(--danger);border-color:var(--danger);margin-left:8px" data-i18n="config.logout" onclick="if(window.handleLogout)window.handleLogout();else{fetch('/api/auth/logout',{method:'POST',credentials:'include'}).finally(function(){window.location.href='/'})}">Déconnexion</button>
|
||||
<span class="profile-saved" id="profile-saved" style="display:none" data-i18n="config.saved">✓ Sauvegardé</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1572,10 +1572,5 @@ function initProfile() {
|
||||
} catch(e) {}
|
||||
});
|
||||
|
||||
// Logout button — calls AuthManager.logout() directly
|
||||
if (logoutBtn) {
|
||||
logoutBtn.addEventListener('click', function() {
|
||||
AuthManager.logout();
|
||||
});
|
||||
}
|
||||
// Logout button — handled inline in index.html (onclick)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user