|
|
@@ -1,5 +1,14 @@
|
|
|
<script>
|
|
|
import favicon from "$lib/assets/favicon.png";
|
|
|
+ import { PUBLIC_API_URL } from "$env/static/public";
|
|
|
+ import { goto } from "$app/navigation";
|
|
|
+
|
|
|
+ const logout = async () => {
|
|
|
+ await fetch(`${PUBLIC_API_URL}/user/logout`, {
|
|
|
+ credentials: "include"
|
|
|
+ });
|
|
|
+ goto("/");
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<header>
|
|
|
@@ -10,6 +19,7 @@
|
|
|
<nav>
|
|
|
<a href="/tokens" class="nav-link">Tokens</a>
|
|
|
<a href="/dashboard/games" class="nav-link">Games</a>
|
|
|
+ <button class="nav-link logout" onclick={logout}>Log Out</button>
|
|
|
</nav>
|
|
|
</header>
|
|
|
|
|
|
@@ -59,4 +69,16 @@
|
|
|
background: #1a1a24;
|
|
|
color: #e5e5ea;
|
|
|
}
|
|
|
+
|
|
|
+ .logout {
|
|
|
+ background: none;
|
|
|
+ border: none;
|
|
|
+ cursor: pointer;
|
|
|
+ font-family: inherit;
|
|
|
+ }
|
|
|
+
|
|
|
+ .logout:hover {
|
|
|
+ background: #1a1a24;
|
|
|
+ color: #e05555;
|
|
|
+ }
|
|
|
</style>
|