mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
fix auth for all admin pages
This commit is contained in:
committed by
Thomas Ruoff
parent
73bb989ca7
commit
31c6a7972d
@@ -63,7 +63,7 @@ function getBillStatusLabel(status: BILL_STATUS) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BookingBillPage({
|
function BookingBillPage({
|
||||||
booking: bookingProp,
|
booking: bookingProp,
|
||||||
milageMax,
|
milageMax,
|
||||||
}: {
|
}: {
|
||||||
@@ -262,3 +262,7 @@ export default function BookingBillPage({
|
|||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BookingBillPage.auth = true;
|
||||||
|
|
||||||
|
export default BookingBillPage;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { BOOKING_STATUS } from '../../../../db/enums'
|
|||||||
|
|
||||||
export const getServerSideProps = getServerSideBooking;
|
export const getServerSideProps = getServerSideBooking;
|
||||||
|
|
||||||
export default function ShowBookingAdmin({
|
function ShowBookingAdmin({
|
||||||
booking: bookingProp,
|
booking: bookingProp,
|
||||||
}: {
|
}: {
|
||||||
booking: Booking
|
booking: Booking
|
||||||
@@ -77,3 +77,7 @@ export default function ShowBookingAdmin({
|
|||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShowBookingAdmin.auth = true;
|
||||||
|
|
||||||
|
export default ShowBookingAdmin;
|
||||||
|
|||||||
@@ -9,13 +9,11 @@ import { getServerSideRecentBookings } from '../../lib/getServerSideProps'
|
|||||||
|
|
||||||
export const getServerSideProps = getServerSideRecentBookings;
|
export const getServerSideProps = getServerSideRecentBookings;
|
||||||
|
|
||||||
export default function AdminRecentBookings({ bookings }) {
|
function AdminRecentBookings({ bookings }) {
|
||||||
const { data: session, status} = useSession();
|
const { data: session, status} = useSession();
|
||||||
|
|
||||||
if (typeof window !== 'undefined' && status === "loading") return null;
|
if (typeof window !== 'undefined' && status === "loading") return null;
|
||||||
|
|
||||||
if (!session) { return <Layout><Denied /></Layout> }
|
|
||||||
|
|
||||||
if (!bookings) return null;
|
if (!bookings) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -72,3 +70,5 @@ export default function AdminRecentBookings({ bookings }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AdminRecentBookings.auth = true
|
AdminRecentBookings.auth = true
|
||||||
|
|
||||||
|
export default AdminRecentBookings;
|
||||||
|
|||||||
Reference in New Issue
Block a user