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.
25 lines
463 B
Svelte
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>
|