Check if user exists or return a 404 before proceeding

pull/170/head
Alex van Andel 2021-05-07 15:17:06 +00:00
parent 17b880335a
commit 9ce82360c0
1 changed files with 8 additions and 2 deletions

View File

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