owlboard-svelte/src/lib/navigation/LogoutButton.svelte
Fred Boniface bc6fd6cdc9 Closes issue: OwlBoard/backend#39
Still awaiting the check auth endpoint, the code only acts on a 401 response.  That means that it currently will not detect if an account is expired.
2023-08-24 20:24:28 +01:00

25 lines
463 B
Svelte

<script lang="ts">
import { logout } from '$lib/libauth';
async function logoutAction() {
await logout();
location.reload();
}
</script>
<button class="logout" type="button" on:click={logoutAction}>Logout</button>
<style>
.logout {
border: none;
background-color: var(--overlay-color);
color: white;
width: 35%;
border-radius: 50px;
font-size: 20px;
min-width: 90px;
margin: 30px;
height: 48px;
}
</style>