diff --git a/pages/api/events/[slug].ts b/pages/api/events/[slug].ts index 7f0caf7..12b02bf 100644 --- a/pages/api/events/[slug].ts +++ b/pages/api/events/[slug].ts @@ -10,7 +10,7 @@ import { Event } from "@prisma/client"; export default async function handler(req: NextApiRequest, res: NextApiResponse>) { handleInterrupts(res, async () => { - const user = await authorizeUser(req, res) + const user = await authorizeUser(req) const canEdit = async (_model: Model, obj?: Event) => { if(obj && obj.creatorId !== user.id) { diff --git a/pages/api/events/mine.ts b/pages/api/events/mine.ts index 2b36308..f1a3391 100644 --- a/pages/api/events/mine.ts +++ b/pages/api/events/mine.ts @@ -9,7 +9,7 @@ import { Event } from "@prisma/client"; export default async function handler(req: NextApiRequest, res: NextApiResponse>) { handleInterrupts(res, async () => { - const user = await authorizeUser(req, res) + const user = await authorizeUser(req) const where = { creatorId: user.id diff --git a/utils/apiAuth.ts b/utils/apiAuth.ts index c959865..45d58e5 100644 --- a/utils/apiAuth.ts +++ b/utils/apiAuth.ts @@ -4,7 +4,7 @@ import { client } from "./prismaClient" import { Interrupt } from "./interrupt" -export async function authorizeUser(req: NextApiRequest, res: NextApiResponse): Promise { +export async function authorizeUser(req: NextApiRequest): Promise { const authorization = req.headers.authorization if (!authorization) {