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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user