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.
This commit is contained in:
24
src/lib/navigation/LogoutButton.svelte
Normal file
24
src/lib/navigation/LogoutButton.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<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>
|
||||
@@ -1,15 +1,16 @@
|
||||
<p id="load">Loading...</p>
|
||||
|
||||
<style>
|
||||
#load {
|
||||
margin-top: 5px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: white;
|
||||
animation: pulse-loading 2.5s linear infinite;
|
||||
}
|
||||
@keyframes pulse-loading {
|
||||
#load {
|
||||
margin-top: 5px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: white;
|
||||
animation: pulse-loading 2.5s linear infinite;
|
||||
}
|
||||
@keyframes pulse-loading {
|
||||
50% {
|
||||
color: rgb(136, 164, 255);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user