* refactor: logout functionality * feat: add billing and logout in sidebar * fix: spacing * feat: user dropdown * Improve sidebar button ui --------- Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
12 lines
309 B
TypeScript
12 lines
309 B
TypeScript
import { removeAuthToken } from './jwt';
|
|
|
|
export const REDIRECT_PAGE_AFTER_AUTH = 'redirect_page_after_auth';
|
|
|
|
export function logout() {
|
|
localStorage.removeItem(REDIRECT_PAGE_AFTER_AUTH);
|
|
removeAuthToken();
|
|
|
|
// Reloading will automatically redirect the user if required
|
|
window.location.href = '/';
|
|
}
|