import { useRouter } from "next/router"; import { Typography } from "@mui/material"; import { Box } from "@mui/system"; import Button from "@mui/material/Button"; import LogoutIcon from "@mui/icons-material/Logout"; import { deleteCookie } from "cookies-next"; export default function Logout() { const router = useRouter(); const handleLogout = () => { // Remove the cookie deleteCookie("cmc-token"); // Use replaceState to replace the current URL with the root URL window.history.replaceState({}, document.title, window.location.href); // Redirect to the login page router.push("/auth/login"); }; return ( <>
Logo Logo Would you like to sign out?
); }