diff --git a/webapp/src/app/[locale]/(GlobalWrapper)/(Auth)/layout.tsx b/webapp/src/app/[locale]/(GlobalWrapper)/(Auth)/layout.tsx index 1c342cc..d0f0230 100644 --- a/webapp/src/app/[locale]/(GlobalWrapper)/(Auth)/layout.tsx +++ b/webapp/src/app/[locale]/(GlobalWrapper)/(Auth)/layout.tsx @@ -10,6 +10,11 @@ import { ReactNode } from 'react' import FullScreenLoader from "@/components/common/fullScreenLoader"; import { load } from '@/redux/features/settings-slice' + +import Cookies from 'universal-cookie'; + +const cookies = new Cookies(); + // HOC for auth pages ( only accept auth user ) export default function LocaleLayout({children} : { children : ReactNode }) { @@ -45,6 +50,9 @@ export default function LocaleLayout({children} : { children : ReactNode }) { // if wasnt logged in this will fire function NotLoggedInCallback() { + console.log('SERVER ::: not logged in') + cookies.remove('authToken', { path: '/' }); + // reset the state to there initial value return router.push(notAuthRedirectPage) } return (