diff --git a/client/src/pages/Dashboard.js b/client/src/pages/Dashboard.js index 41240b8..0265961 100644 --- a/client/src/pages/Dashboard.js +++ b/client/src/pages/Dashboard.js @@ -57,6 +57,12 @@ const Dashboard = () => { alert(data.error) } } + + window.addEventListener("storage", function (event) { + if (event.key === "token" && !event.newValue) { + window.location.replace("/login"); + } + }); return (