diff --git a/src/App.js b/src/App.js index 4060eb1..125565a 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,8 @@ import { useDispatch, useSelector } from 'react-redux'; // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== // +const SESSION_CLEAR_INTERVAL_MS = 30 * 60 * 1000; + const App = () => { let navigate = useNavigate(); useEffect(() => { @@ -23,6 +25,14 @@ const App = () => { navigate('/login'); } }, []); + + useEffect(() => { + const timer = setInterval(() => { + localStorage.clear(); + navigate('/login'); + }, SESSION_CLEAR_INTERVAL_MS); + return () => clearInterval(timer); + }, []); const { openItem } = useSelector((state) => state.menu); console.log('openItem', openItem);