import {useEffect} from 'react' import Router from 'next/router' import useUser from './useUser' export default function useAccountRedirect(){ const user = useUser() useEffect(()=>{ if(user) Router.push('/account') }, [user]) }