From 1929208af646602e44bdabfdb233d4185f18fd85 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Thu, 17 Aug 2023 20:58:19 -0600 Subject: [PATCH] Lint --- src/middleware.ts | 7 +------ src/pages/api/private/ping.ts | 2 +- src/pages/api/public/ping.ts | 2 +- src/pages/api/webhooks/index.ts | 1 - 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index c4ea50d..bf28af1 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -6,7 +6,6 @@ export default authMiddleware({ publicRoutes: ["/", "/api/public/(.*)"], afterAuth: async (auth, req) => { if (!auth.userId && auth.isPublicRoute) { - console.log("1"); return NextResponse.next(); } @@ -14,9 +13,7 @@ export default authMiddleware({ req.nextUrl.pathname.includes("/api/webhooks") || req.nextUrl.pathname.includes("/api/private") ) { - console.log("2"); const isValid = await validateRequest(req); - console.log("Is Valid?: ", isValid); if (isValid) { return NextResponse.next(); } else { @@ -24,9 +21,7 @@ export default authMiddleware({ } } if (!auth.userId && !auth.isPublicRoute) { - console.log(req.nextUrl); - console.log("3"); - return redirectToSignIn({ returnBackUrl: req.url }); + redirectToSignIn({ returnBackUrl: req.url }); } }, }); diff --git a/src/pages/api/private/ping.ts b/src/pages/api/private/ping.ts index 6a8ca54..ca89e26 100644 --- a/src/pages/api/private/ping.ts +++ b/src/pages/api/private/ping.ts @@ -5,7 +5,7 @@ export const config = { regions: ["pdx1"], }; -export default async function handler() { +export default function handler() { return NextResponse.json( { message: "Private Pong!" }, { status: 200, statusText: "SUCCESS" } diff --git a/src/pages/api/public/ping.ts b/src/pages/api/public/ping.ts index 7af559a..e5b6a76 100644 --- a/src/pages/api/public/ping.ts +++ b/src/pages/api/public/ping.ts @@ -5,7 +5,7 @@ export const config = { regions: ["pdx1"], }; -export default async function handler() { +export default function handler() { return NextResponse.json( { message: "Public Pong!" }, { status: 200, statusText: "SUCCESS" } diff --git a/src/pages/api/webhooks/index.ts b/src/pages/api/webhooks/index.ts index 294f7a8..1599c00 100644 --- a/src/pages/api/webhooks/index.ts +++ b/src/pages/api/webhooks/index.ts @@ -1,5 +1,4 @@ import type { NextApiRequest, NextApiResponse } from "next"; -import { validateRequest } from "~/server/unkey"; import { onUserCreatedHandler, onUserDeletedHandler,