fix auth for all admin pages

This commit is contained in:
Thomas Ruoff
2021-12-08 23:38:50 +01:00
committed by Thomas Ruoff
parent 73bb989ca7
commit 31c6a7972d
3 changed files with 13 additions and 5 deletions

View File

@@ -9,13 +9,11 @@ import { getServerSideRecentBookings } from '../../lib/getServerSideProps'
export const getServerSideProps = getServerSideRecentBookings;
export default function AdminRecentBookings({ bookings }) {
function AdminRecentBookings({ bookings }) {
const { data: session, status} = useSession();
if (typeof window !== 'undefined' && status === "loading") return null;
if (!session) { return <Layout><Denied /></Layout> }
if (!bookings) return null;
return (
@@ -72,3 +70,5 @@ export default function AdminRecentBookings({ bookings }) {
}
AdminRecentBookings.auth = true
export default AdminRecentBookings;