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> </script>
<div class="nav"> <div class="nav">
@ -24,12 +29,10 @@
{#if logoUrl} {#if logoUrl}
<img class="logo" alt="logo" src={logoUrl} height="48" /> <img class="logo" alt="logo" src={logoUrl} height="48" />
{/if} {/if}
{#if title} {#if title}<span>{title}</span>{/if}
<span>{title}</span>
{/if}
</a> </a>
<div class="nav__controls"> <div class="nav__controls">
<div>Log out</div> <div on:click={logOut}>Log out</div>
</div> </div>
</div> </div>
<div class="nav__menu" bind:this={itemContainer} /> <div class="nav__menu" bind:this={itemContainer} />