Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

next js redirect if not logged in

useEffect(() => {
  if (userData.email) {
    router.push('/redirect') // redirects if there is no user
  }
}, [userData])
Source by www.dailydeveloping.com #
 
PREVIOUS NEXT
Tagged: #js #redirect #logged
ADD COMMENT
Topic
Name
4+3 =