diff --git a/components/Navbar.js b/components/Navbar.js index 684a244..0ec157c 100644 --- a/components/Navbar.js +++ b/components/Navbar.js @@ -8,6 +8,7 @@ import IconButton from '@material-ui/core/IconButton'; import MenuIcon from '@material-ui/icons/Menu'; import Link from 'next/link' import AuthButton from './AuthButton' +import { useSession } from 'next-auth/client' const useStyles = makeStyles((theme) => ({ root: { @@ -22,6 +23,7 @@ const useStyles = makeStyles((theme) => ({ })); export default function ButtonAppBar() { + const [session, loading] = useSession() const classes = useStyles(); return ( @@ -38,9 +40,9 @@ export default function ButtonAppBar() { Cath.exe - + {session && } - + {session && } diff --git a/pages/controlpanel/commands.js b/pages/controlpanel/commands.js index 8e2d9e8..8605bd5 100644 --- a/pages/controlpanel/commands.js +++ b/pages/controlpanel/commands.js @@ -8,6 +8,7 @@ import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import Paper from '@material-ui/core/Paper'; import Head from 'next/head' +import { useSession } from 'next-auth/client' const useStyles = makeStyles({ table: { @@ -27,35 +28,43 @@ const rows = [ ]; function Commands() { + const [session, loading] = useSession() const classes = useStyles(); return ( <> - - Cath Commands - - - - - - Commands - Description - Status - - - - {rows.map((row) => ( - - - {row.name} - - {row.description} - {row.status ? 'Online' : 'Offline'} + {session && + <> + + Cath Commands + + +
+ + + Commands + Description + Status - ))} - -
-
+ + + {rows.map((row) => ( + + + {row.name} + + {row.description} + {row.status ? 'Online' : 'Offline'} + + ))} + + + + + } {!session && <> +

Seems like you're not logged in. Log in to get started!

+ + } ); }