//Lib import Head from 'next/head'; import { useSession } from 'next-auth/react'; import { useRouter } from 'next/router'; import Image from 'next/image'; export default function Error404() { //Var const { status } = useSession(); const router = useRouter(); if (status === 'authenticated') { return ( <> 404 - Page not found
404 - Page not found
); } else { router.replace('/login'); } }