Skip to content

Commit

Permalink
localStorageremoveitem added client-side
Browse files Browse the repository at this point in the history
  • Loading branch information
ampodo committed Oct 27, 2023
1 parent 170091f commit da218a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit da218a5

Please sign in to comment.