Protected control panel
This commit is contained in:
parent
8d750fd31c
commit
53cca9581d
1 changed files with 18 additions and 7 deletions
|
@ -1,17 +1,28 @@
|
||||||
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 (
|
||||||
<>
|
<>
|
||||||
<Head>
|
{!session && <>
|
||||||
<title>Cath Control Panel</title>
|
<h1>Seems like you're not logged in. Log in to get started!</h1>
|
||||||
</Head>
|
</>
|
||||||
<div>
|
}
|
||||||
<h1>Control Panel</h1>
|
{session && <>
|
||||||
<CardContainer link='/controlpanel/commands'>Commands</CardContainer>
|
<Head>
|
||||||
</div>
|
<title>Cath Control Panel</title>
|
||||||
|
</Head>
|
||||||
|
<div>
|
||||||
|
<h1>Control Panel</h1>
|
||||||
|
<CardContainer link='/controlpanel/commands'>Commands</CardContainer>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue