Migrate to a monorepo structure (#2909)
This commit is contained in:
12
packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts
Normal file
12
packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
|
||||
import { isVerifyPendingState } from '@/auth/states/isVerifyPendingState';
|
||||
|
||||
import { tokenPairState } from '../states/tokenPairState';
|
||||
|
||||
export const useIsLogged = (): boolean => {
|
||||
const [tokenPair] = useRecoilState(tokenPairState);
|
||||
const isVerifyPending = useRecoilValue(isVerifyPendingState);
|
||||
|
||||
return !!tokenPair && !isVerifyPending;
|
||||
};
|
||||
Reference in New Issue
Block a user