mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-26 09:20:06 +02:00
38 lines
986 B
JavaScript
38 lines
986 B
JavaScript
|
//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 (
|
||
|
<>
|
||
|
<Head>
|
||
|
<title>404 - Page not found</title>
|
||
|
</Head>
|
||
|
<div
|
||
|
style={{
|
||
|
marginTop: '30px',
|
||
|
height: '60%',
|
||
|
width: '60%',
|
||
|
position: 'absolute',
|
||
|
}}
|
||
|
>
|
||
|
<Image
|
||
|
src='/404.svg'
|
||
|
alt='404 - Page not found'
|
||
|
layout='fill'
|
||
|
/>
|
||
|
</div>
|
||
|
</>
|
||
|
);
|
||
|
} else {
|
||
|
router.replace('/login');
|
||
|
}
|
||
|
}
|