diff --git a/components/Navigation.tsx b/components/Navigation.tsx
index cc7d4bb..a3c047c 100644
--- a/components/Navigation.tsx
+++ b/components/Navigation.tsx
@@ -17,6 +17,14 @@ import {
useDisclosure,
} from "@chakra-ui/react";
+async function destroySession() {
+ await fetch("/api/auth/session", {
+ method: "DELETE",
+ }).catch(() => {});
+
+ location.assign("/");
+}
+
function getAvatarUrl(userData: { [k: string]: any }): string {
const BASE = "https://cdn.discordapp.com/";
@@ -37,6 +45,7 @@ export default function (props: {
permissions?: number;
username?: string;
}) {
+ let data = { ...props };
const isDesktop = useBreakpointValue({ base: false, lg: true });
const { isOpen, onClose, onOpen } = useDisclosure();
@@ -106,18 +115,19 @@ export default function (props: {
- {props.hide ? null : props.id ? (
+ {data.hide ? null : data.id ? (
- {props.id ? `${props.username}#${props.discriminator}` : ""}
+ {data.id ? `${data.username}#${data.discriminator}` : ""}