Skip to content

Commit

Permalink
Update verify-qstash.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
devkiran committed Jan 13, 2025
1 parent a977192 commit ed335ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/web/lib/cron/verify-qstash.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { log } from "@dub/utils";
import { Receiver } from "@upstash/qstash";
import { DubApiError } from "../api/errors";

Expand Down Expand Up @@ -29,6 +30,15 @@ export const verifyQstashSignature = async ({
});

if (!isValid) {
const url = req.url;
const messageId = req.headers.get("Upstash-Message-Id");

log({
message: `Invalid QStash request signature: *${url}* - *${messageId}*`,
type: "errors",
mention: true,
});

throw new DubApiError({
code: "unauthorized",
message: "Invalid QStash request signature.",
Expand Down

0 comments on commit ed335ab

Please sign in to comment.