[WIP] Fix Logout Delete Token
This commit is contained in:
@@ -6,6 +6,7 @@ import { Box, Divider, Typography, Stack, MenuItem, Avatar } from '@mui/material
|
||||
import MenuPopover from '../../../components/MenuPopover';
|
||||
import { IconButtonAnimate } from '../../../components/animate';
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import useAuth from '../../../hooks/useAuth';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -29,6 +30,7 @@ const MENU_OPTIONS = [
|
||||
export default function AccountPopover() {
|
||||
const [open, setOpen] = useState<HTMLElement | null>(null);
|
||||
const navigate = useNavigate();
|
||||
const { logout } = useAuth();
|
||||
|
||||
const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setOpen(event.currentTarget);
|
||||
@@ -39,6 +41,7 @@ export default function AccountPopover() {
|
||||
};
|
||||
|
||||
const handleLogout = () => {
|
||||
logout();
|
||||
navigate('/auth/login');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user