From da218a5d8bc17a57502ab5eb309fa485a3023690 Mon Sep 17 00:00:00 2001 From: Vladimir Skrjabin Date: Fri, 27 Oct 2023 12:13:44 +0300 Subject: [PATCH] localStorageremoveitem added client-side --- src/components/Navbar.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 18f85ef..04dff42 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -39,6 +39,9 @@ function NavList() { dispatch(SetLoading(true)); await axios.get("/api/users/logout"); message.success("Logged out successfully"); + + localStorage.removeItem("token"); + router.push("/login"); } catch (error) { message.error(error.response.data.message || error.message);