diff --git a/app/api/cron/route.ts b/app/api/cron/route.ts index 151b81c..b6f7ca6 100644 --- a/app/api/cron/route.ts +++ b/app/api/cron/route.ts @@ -6,22 +6,9 @@ export async function POST(req: Request) { throw new Error("CRON_API_KEY is not defined"); } - const auth = req.headers.get("Authorization"); - if (auth !== `Bearer ${process.env.CRON_API_KEY}`) { - logError("api/cron: Unauthorized", { - req: { - len: auth?.length, - pref: auth?.substring(0, 10), - suf: auth?.substring(auth.length - 3), - }, - env: { - len: process.env.CRON_API_KEY?.length, - pref: process.env.CRON_API_KEY?.substring(0, 3), - suf: process.env.CRON_API_KEY?.substring( - process.env.CRON_API_KEY.length - 3, - ), - }, - }); + if ( + req.headers.get("Authorization") !== `Bearer ${process.env.CRON_API_KEY}` + ) { return Response.json({ message: "Unauthorized" }, { status: 401 }); }