diff --git a/src/components/PrivateRoute.js b/src/components/PrivateRoute.js index fce26b410..af764e245 100644 --- a/src/components/PrivateRoute.js +++ b/src/components/PrivateRoute.js @@ -51,7 +51,7 @@ const PrivateRoute = ({ children }) => { const tokenSentInSession = sessionStorage.getItem('tokenSentInSession'); console.log('tokenSentInSession:', tokenSentInSession); - if (tokenSentInSession === 'false') { + if (tokenSentInSession !== 'true') { setLoading(true); try { const fcmToken = await fetchToken(); diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index d15add45b..3709fb620 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -41,6 +41,7 @@ const Sidebar = ({ isOpen, toggle }) => { const handleLogout = async () => { api.clearSession(); await keystore.close(); + sessionStorage.removeItem('tokenSentInSession'); navigate('/login'); };