diff --git a/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts b/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts index a7fda28fd9d..bd60f9c62e9 100644 --- a/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts +++ b/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts @@ -1,7 +1,8 @@ import { tokenPairState } from '@/auth/states/tokenPairState'; +import { isValidAuthTokenPair } from '@/apollo/utils/isValidAuthTokenPair'; import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState'; export const useIsLogged = (): boolean => { const [tokenPair] = useAtomState(tokenPairState); - return !!tokenPair; + return isValidAuthTokenPair(tokenPair); };