Protected control panel

This commit is contained in:
qt-coder 2021-06-22 08:22:10 +08:00
parent 8d750fd31c
commit 53cca9581d

View file

@ -1,10 +1,19 @@
import React from 'react' import React from 'react'
import CardContainer from '../../components/CardContainer' import CardContainer from '../../components/CardContainer'
import Head from 'next/head' import Head from 'next/head'
import { useSession } from 'next-auth/client'
function index() { function index() {
const [session, loading] = useSession()
return ( return (
<> <>
{!session && <>
<h1>Seems like you&apos;re not logged in. Log in to get started!</h1>
</>
}
{session && <>
<Head> <Head>
<title>Cath Control Panel</title> <title>Cath Control Panel</title>
</Head> </Head>
@ -13,6 +22,8 @@ function index() {
<CardContainer link='/controlpanel/commands'>Commands</CardContainer> <CardContainer link='/controlpanel/commands'>Commands</CardContainer>
</div> </div>
</> </>
}
</>
) )
} }