Add log out functionality

This commit is contained in:
Andrew Kingston 2020-10-14 20:12:41 +01:00
parent f9e6b3e5b4
commit 55447f282d
1 changed files with 7 additions and 4 deletions

View File

@ -16,6 +16,11 @@
}
}
}
const logOut = () => {
localStorage.removeItem("budibase:token")
location.reload()
}
</script>
<div class="nav">
@ -24,12 +29,10 @@
{#if logoUrl}
<img class="logo" alt="logo" src={logoUrl} height="48" />
{/if}
{#if title}
<span>{title}</span>
{/if}
{#if title}<span>{title}</span>{/if}
</a>
<div class="nav__controls">
<div>Log out</div>
<div on:click={logOut}>Log out</div>
</div>
</div>
<div class="nav__menu" bind:this={itemContainer} />