From 47938f1e8ef706bca228dba0b6f16a0e627306d0 Mon Sep 17 00:00:00 2001 From: Anshul Khandelwal Date: Thu, 7 Dec 2023 18:03:30 -0800 Subject: [PATCH] logout button + cookie deletion --- Frontend/src/pages/nav.js | 116 ++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/Frontend/src/pages/nav.js b/Frontend/src/pages/nav.js index 3e7e612..1a055e0 100644 --- a/Frontend/src/pages/nav.js +++ b/Frontend/src/pages/nav.js @@ -1,102 +1,95 @@ -// Import React import React from "react"; import Link from "next/link"; -// NavBar Component + + const NavBar = () => { + const handleLogout = () => { + // Set the 'token' cookie to expire immediately, effectively logging the user out + document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;"; + + + + }; + return (