FrontEnd Bug Fix

This commit is contained in:
brausjonas
2023-05-24 16:05:21 +02:00
parent 337aea6a65
commit f42f2df078
7 changed files with 1314 additions and 5 deletions
+24
View File
@@ -0,0 +1,24 @@
import Button from "@/components/Button";
import {useRouter} from "next/router";
export default function Logout()
{
const router = useRouter()
async function logout()
{
let url = "http://localhost:8080/users/logout?sessionid=" + localStorage.getItem("sessionid");
await fetch(url)
await router.push("/")
}
return (
<div style={{
position: "absolute",
left: 20,
top: 20
}}>
<Button onClick={() => logout()} text={"Logout"} color={"#77932b"} width={100} height={40}/>
</div>
)
}