on logout use clearTokenCookies

This commit is contained in:
Ishaan Jaff 2025-03-03 16:39:30 -08:00
parent 03aa404d4f
commit 0bf8e4ba23

View file

@ -8,6 +8,7 @@ import {
UserOutlined,
LogoutOutlined
} from '@ant-design/icons';
import { clearTokenCookies } from "@/utils/cookieUtils";
interface NavbarProps {
userID: string | null;
userRole: string | null;
@ -27,7 +28,7 @@ const Navbar: React.FC<NavbarProps> = ({
let logoutUrl = proxySettings?.PROXY_LOGOUT_URL || "";
const handleLogout = () => {
document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
clearTokenCookies();
window.location.href = logoutUrl;
};