From b93cbfa9907f133b92d1eecc9fa428febecf0f97 Mon Sep 17 00:00:00 2001 From: wil Date: Mon, 15 Apr 2024 10:24:58 -0400 Subject: [PATCH] less misleading redircting message, more comments for continuous dev --- app/contexts/Authentication/AuthenticationProvider.tsx | 10 +++++++--- app/modules/withProtectedRoute/index.tsx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/contexts/Authentication/AuthenticationProvider.tsx b/app/contexts/Authentication/AuthenticationProvider.tsx index fa9e47be0..f94a31793 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 aff5cb6a7..9f05fbf30 100644 --- a/app/modules/withProtectedRoute/index.tsx +++ b/app/modules/withProtectedRoute/index.tsx @@ -27,7 +27,7 @@ const RedirectToLogin = ()=>{ },[]); return (
- +
); } \ No newline at end of file