nextjs redirect to other page if user is not looged in code example
Example: next js redirect if not logged in
useEffect(() => {
if (userData.email) {
router.push('/redirect') // redirects if there is no user
}
}, [userData])
useEffect(() => {
if (userData.email) {
router.push('/redirect') // redirects if there is no user
}
}, [userData])