diff --git a/app/contexts/Authentication/AuthenticationProvider.tsx b/app/contexts/Authentication/AuthenticationProvider.tsx index fa9e47be05..f94a317936 100644 --- a/app/contexts/Authentication/AuthenticationProvider.tsx +++ b/app/contexts/Authentication/AuthenticationProvider.tsx @@ -68,9 +68,13 @@ export const AuthenticationProvider = ({children}:{children:ReactNode})=>{ const logout = useCallback(()=>{ const sessionToken = localStorage.getItem(STORAGE_KEYS.SESSION_TOKEN); if (sessionToken !== null){ - DestroySession(sessionToken).then((res)=>{ - //TODO: error handling maybe necessary - });} + console.log('destroying the session'); + DestroySession(sessionToken).then((res)=>{ + if (res) console.log('Logout Success'); // do nothing + else console.log(res); //TODO: error handling maybe necessary + }) + ;} + // regarldess, clear the state and useeffect will rid of the localstorage setLogoutState(); },[]); diff --git a/app/modules/withProtectedRoute/index.tsx b/app/modules/withProtectedRoute/index.tsx index aff5cb6a75..9f05fbf30b 100644 --- a/app/modules/withProtectedRoute/index.tsx +++ b/app/modules/withProtectedRoute/index.tsx @@ -27,7 +27,7 @@ const RedirectToLogin = ()=>{ },[]); return (