Add logout button to the sidebar
This commit is contained in:
@@ -34,6 +34,12 @@ function showErrorBanner(msg, detail = '') {
|
||||
setTimeout(() => banner && banner.remove(), 8000);
|
||||
}
|
||||
|
||||
function logout() {
|
||||
localStorage.removeItem('auth_token');
|
||||
localStorage.removeItem('token');
|
||||
window.location.href = '/login';
|
||||
}
|
||||
|
||||
function getAuthToken() {
|
||||
return localStorage.getItem('auth_token');
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
<a href="/reset" class="nav-item" style="color: #dc3545;">
|
||||
<span class="icon">⚠️</span> Zerar Sistema
|
||||
</a>
|
||||
<a href="#" class="nav-item" onclick="logout(); return false;">
|
||||
<span class="icon">🚪</span> Sair
|
||||
</a>
|
||||
<div class="nav-divider"></div>
|
||||
<button id="toggleDisabledBtn" class="btn btn-secondary" style="margin: 10px 20px; width: calc(100% - 40px);">
|
||||
<span id="toggleText">Ocultas</span>
|
||||
|
||||
Reference in New Issue
Block a user