Check if user exists or return a 404 before proceeding

This commit is contained in:
Alex van Andel 2021-05-07 15:17:06 +00:00
parent 17b880335a
commit 9ce82360c0

View file

@ -266,6 +266,12 @@ export async function getServerSideProps(context) {
} }
}); });
if (!user) {
return {
notFound: true,
}
}
const eventType = await prisma.eventType.findFirst({ const eventType = await prisma.eventType.findFirst({
where: { where: {
userId: user.id, userId: user.id,