Skip to content

Commit

Permalink
debug cron
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Dec 6, 2024
1 parent 44ae862 commit d28ace2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/api/cron/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ export async function POST(req: Request) {
if (
req.headers.get("Authorization") !== `Bearer ${process.env.CRON_API_KEY}`
) {
logError("api/cron: Unauthorized");
logError("api/cron: Unauthorized", {
req: {
len: req.headers.get("Authorization")?.length,
pref: req.headers.get("Authorization")?.substring(0, 3),
},
env: {
len: process.env.CRON_API_KEY?.length,
pref: process.env.CRON_API_KEY?.substring(0, 3),
},
});
return Response.json({ message: "Unauthorized" }, { status: 401 });
}

Expand Down

0 comments on commit d28ace2

Please sign in to comment.